home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / comm / term / andrew.dif next >
Encoding:
Text File  |  1993-09-10  |  143.5 KB  |  5,086 lines

  1. diff -cr --new-file andrew.orig/ams/libs/cui/andmchs.c andrew/ams/libs/cui/andmchs.c
  2. *** andrew.orig/ams/libs/cui/andmchs.c    Fri Jan 24 03:39:12 1992
  3. --- andrew/ams/libs/cui/andmchs.c    Sat Sep  4 12:06:39 1993
  4. ***************
  5. *** 38,44 ****
  6.   #else /* AFS_ENV */
  7.   #define TOKENS_LEN 100
  8.   #endif /* AFS_ENV */
  9.   extern int (*CUI_GenericClientSignalHandler)();
  10.   extern char *sys_errlist[];
  11.   extern int sys_nerr;
  12. --- 38,46 ----
  13.   #else /* AFS_ENV */
  14.   #define TOKENS_LEN 100
  15.   #endif /* AFS_ENV */
  16. ! #ifdef linux
  17. ! #include <bsd/signal.h>
  18. ! #endif
  19.   extern int (*CUI_GenericClientSignalHandler)();
  20.   extern char *sys_errlist[];
  21.   extern int sys_nerr;
  22. ***************
  23. *** 408,416 ****
  24. --- 410,420 ----
  25.       case SIGQUIT:
  26.           Text = "Quit";
  27.           break;
  28. + #ifdef SIGBUS
  29.       case SIGBUS:
  30.           Text = "Bus Error";
  31.           break;
  32. + #endif
  33.       case SIGSEGV:
  34.           Text = "Segmentation Violation";
  35.           break;
  36. ***************
  37. *** 459,465 ****
  38. --- 463,471 ----
  39.   
  40.       signal(SIGINT, SnapifiedClientSignalHandler);
  41.       signal(SIGQUIT, SnapifiedClientSignalHandler);
  42. + #ifdef SIGBUS
  43.       signal(SIGBUS, SnapifiedClientSignalHandler);
  44. + #endif
  45.       signal(SIGSEGV, SnapifiedClientSignalHandler);
  46.       signal(SIGTERM, SnapifiedClientSignalHandler);
  47.   #ifdef SIGTSTP
  48. diff -cr --new-file andrew.orig/ams/libs/ms/bldreply.c andrew/ams/libs/ms/bldreply.c
  49. *** andrew.orig/ams/libs/ms/bldreply.c    Fri Jan 24 03:39:54 1992
  50. --- andrew/ams/libs/ms/bldreply.c    Sat Sep  4 12:06:39 1993
  51. ***************
  52. *** 10,15 ****
  53. --- 10,18 ----
  54.   */
  55.   #include <ms.h>
  56.   #include <hdrparse.h>
  57. + #ifndef NULL
  58. + #define NULL ((void*)0)
  59. + #endif
  60.   
  61.   #ifndef _IBMR2
  62.   extern char *malloc();
  63. diff -cr --new-file andrew.orig/ams/libs/ms/bldwide.c andrew/ams/libs/ms/bldwide.c
  64. *** andrew.orig/ams/libs/ms/bldwide.c    Fri Jan 24 03:39:55 1992
  65. --- andrew/ams/libs/ms/bldwide.c    Sat Sep  4 12:06:39 1993
  66. ***************
  67. *** 10,16 ****
  68.   */
  69.   #include <ms.h>
  70.   #include <hdrparse.h>
  71.   #ifndef _IBMR2
  72.   extern char *malloc(), *realloc();
  73.   #endif /* _IBMR2 */
  74. --- 10,18 ----
  75.   */
  76.   #include <ms.h>
  77.   #include <hdrparse.h>
  78. ! #ifndef NULL
  79. ! #define NULL ((void*)0)
  80. ! #endif
  81.   #ifndef _IBMR2
  82.   extern char *malloc(), *realloc();
  83.   #endif /* _IBMR2 */
  84. diff -cr --new-file andrew.orig/ams/libs/ms/fixsub.c andrew/ams/libs/ms/fixsub.c
  85. *** andrew.orig/ams/libs/ms/fixsub.c    Fri Jan 24 03:40:11 1992
  86. --- andrew/ams/libs/ms/fixsub.c    Sat Sep  4 12:06:40 1993
  87. ***************
  88. *** 9,14 ****
  89. --- 9,17 ----
  90.   $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/ams/libs/ms/RCS/fixsub.c,v $
  91.   */
  92.   #include <ms.h>
  93. + #ifndef NULL
  94. + #define NULL ((void*)0)
  95. + #endif
  96.   
  97.   #ifndef _IBMR2
  98.   extern char *malloc();
  99. diff -cr --new-file andrew.orig/ams/libs/ms/freemsg.c andrew/ams/libs/ms/freemsg.c
  100. *** andrew.orig/ams/libs/ms/freemsg.c    Fri Jan 24 03:40:13 1992
  101. --- andrew/ams/libs/ms/freemsg.c    Sat Sep  4 12:06:40 1993
  102. ***************
  103. *** 10,16 ****
  104.   */
  105.   #include <ms.h>
  106.   #include <hdrparse.h>
  107.   /* 2 routines for backward compatibility */
  108.   
  109.   FreeMessage(Msg, FreeSnapshot)
  110. --- 10,18 ----
  111.   */
  112.   #include <ms.h>
  113.   #include <hdrparse.h>
  114. ! #ifndef NULL
  115. ! #define NULL ((void*)0)
  116. ! #endif
  117.   /* 2 routines for backward compatibility */
  118.   
  119.   FreeMessage(Msg, FreeSnapshot)
  120. diff -cr --new-file andrew.orig/ams/libs/ms/init.c andrew/ams/libs/ms/init.c
  121. *** andrew.orig/ams/libs/ms/init.c    Fri Jan 24 03:40:30 1992
  122. --- andrew/ams/libs/ms/init.c    Sat Sep  4 12:06:40 1993
  123. ***************
  124. *** 26,31 ****
  125. --- 26,34 ----
  126.   #ifdef hpux
  127.   #include <signal.h>
  128.   #endif /* hpux */
  129. + #ifdef linux
  130. + #include <bsd/signal.h>
  131. + #endif
  132.   
  133.   extern char **environ;
  134.   extern char *getprofile(), *index(), *rindex(), *StripWhiteEnds();
  135. ***************
  136. *** 452,460 ****
  137. --- 455,465 ----
  138.       case SIGQUIT:
  139.           Text = "Quit";
  140.           break;
  141. + #ifdef SIGBUS
  142.       case SIGBUS:
  143.           Text = "Bus Error";
  144.           break;
  145. + #endif
  146.       case SIGSEGV:
  147.           Text = "Segmentation Violation";
  148.           break;
  149. ***************
  150. *** 542,548 ****
  151. --- 547,555 ----
  152.   
  153.       signal(SIGINT, DieYouHeathenSwine);
  154.       signal(SIGQUIT, DieYouHeathenSwine);
  155. + #ifdef SIGBUS
  156.       signal(SIGBUS, DieYouHeathenSwine);
  157. + #endif
  158.       signal(SIGSEGV, DieYouHeathenSwine);
  159.       signal(SIGTERM, DieYouHeathenSwine);
  160.   #ifdef SIGTSTP
  161. diff -cr --new-file andrew.orig/ams/libs/ms/prsdate.y andrew/ams/libs/ms/prsdate.y
  162. *** andrew.orig/ams/libs/ms/prsdate.y    Fri Jan 24 03:40:54 1992
  163. --- andrew/ams/libs/ms/prsdate.y    Sat Sep  4 12:06:40 1993
  164. ***************
  165. *** 83,254 ****
  166.   /*
  167.    *  Month and week day names (upper case only) and other words.
  168.    */
  169. ! struct stable strings[] =
  170. ! {
  171. !   { "JAN*UARY", MONTH, 0 },        /* months (0-11) */
  172. !   { "FEB*RUARY", MONTH, 1 },
  173. !   { "MAR*CH", MONTH, 2 },
  174. !   { "APR*IL", MONTH, 3 },
  175. !   { "MAY", MONTH, 4 },
  176. !   { "JUN*E", MONTH, 5 },
  177. !   { "JUL*Y", MONTH, 6 },
  178. !   { "AUG*UST", MONTH, 7 },
  179. !   { "SEP*TEMBER", MONTH, 8 },
  180. !   { "OCT*OBER", MONTH, 9 },
  181. !   { "NOV*EMBER", MONTH, 10 },
  182. !   { "DEC*EMBER", MONTH, 11 },
  183. !   { "SUN*DAY", WEEKDAY, 0 },    /* days of the week (0-6) */
  184. !   { "MON*DAY", WEEKDAY, 1 },
  185. !   { "TUE*SDAY", WEEKDAY, 2 },
  186. !   { "WED*NESDAY", WEEKDAY, 3 },
  187. !   { "THU*RSDAY", WEEKDAY, 4 },
  188. !   { "FRI*DAY", WEEKDAY, 5 },
  189. !   { "SAT*URDAY", WEEKDAY, 6 },
  190. !   { "YESTERDAY", TODAY, -1 },    /* relative to today */
  191. !   { "TODAY", TODAY, 0 },
  192. !   { "TONIGHT", TONIGHT, 0 },
  193. !   { "NOW", NOW, 0 },
  194. !   { "AGO", AGO, 0 },
  195. !   { "TOMORROW", TODAY, 1 },
  196. !   { "NEXT", NEXT, 0 },        /* keywords */
  197. !   { "THIS", THIS, 0 },
  198. !   { "DAY*S", DAY, 0 },
  199. !   { "WEEK*S", WEEK, 0 },
  200. !   { "MONTH*S", WORD_MONTH, 0 },
  201. !   { "YEAR*S", YEAR, 0 },
  202. !   { "FORTNIGHT", FORTNIGHT, 0 },    /* two weeks (Australian) */
  203. ! /*  { "EVERY", EVERY, 0 }, */
  204. !   { "FROM", FROM, 0 },
  205. !   { "AFTER", AFTER, 0 },
  206. !   { "BEFORE", BEFORE, 0 },
  207. !   { "LAST", LAST, 0 },
  208. !   { "THE", THE, 0 },
  209. ! /*  { "A", A, 0 }, */
  210. !   { "AT", AT, 0 },
  211. !   { "ON", ON, 0 },
  212. !   { "IN", IN, 0 },
  213. !   { "OF", OF, 0 },
  214. ! /*  { "AND", AND, 0 }, */
  215. !   { "MORNING", TIMEKEY, 0 },    /* time keywords. Morning is 0:00 - 11:59 */
  216. !   { "AFTERNOON", TIMEKEY, 12 }, /* Afternoon is 12:00 - 23:59 */
  217. !   { "EVENING", TIMEKEY, 15 },    /* Evening is 15:00 - 02:59 */
  218. !   { "NIGHT", TIMEKEY, 17 },    /* Night is 17:00 - 04:59 */
  219. !   { "NOON", NOON, 12 },        /* time specifications */
  220. !   { "MIDNIGHT", NOON, 24 },
  221. !   { "ONE", NWORD, 1 },        /* numbers up to 19 */
  222. !   { "TWO", NWORD, 2 },
  223. !   { "THREE", NWORD, 3 },
  224. !   { "FOUR", NWORD, 4 },
  225. !   { "FIVE", NWORD, 5 },
  226. !   { "SIX", NWORD, 6 },
  227. !   { "SEVEN", NWORD, 7 },
  228. !   { "EIGHT", NWORD, 8 },
  229. !   { "NINE", NWORD, 9 },
  230. !   { "TEN", NWORD, 10 },
  231. !   { "ELEVEN", NWORD, 11 },
  232. !   { "TWELVE", NWORD, 12 },
  233. !   { "THIRTEEN", NWORD, 13 },
  234. !   { "FOURTEEN", NWORD, 14 },
  235. !   { "FIFTEEN", NWORD, 15 },
  236. !   { "SIXTEEN", NWORD, 16 },
  237. !   { "SEVENTEEN", NWORD, 17 },
  238. !   { "EIGHTEEN", NWORD, 18 },
  239. !   { "NINETEEN", NWORD, 19 },
  240. !   { "FIRST", NTHWORD, 1 },        /* number up to 19th */
  241. !   { "SECOND", NTHWORD, 2 },
  242. !   { "THIRD", NTHWORD, 3 },
  243. !   { "FOURTH", NTHWORD, 4 },
  244. !   { "FIFTH", NTHWORD, 5 },
  245. !   { "SIXTH", NTHWORD, 6 },
  246. !   { "SEVENTH", NTHWORD, 7 },
  247. !   { "EIGHT", NTHWORD, 8 },
  248. !   { "NINTH", NTHWORD, 9 },
  249. !   { "TENTH", NTHWORD, 10 },
  250. !   { "ELEVENTH", NTHWORD, 11 },
  251. !   { "TWELFTH", NTHWORD, 12 },
  252. !   { "THIRTEENTH", NTHWORD, 13 },
  253. !   { "FOURTEENTH", NTHWORD, 14 },
  254. !   { "FIFTEENTH", NTHWORD, 15 },
  255. !   { "SIXTEENTH", NTHWORD, 16 },
  256. !   { "SEVENTEENTH", NTHWORD, 17 },
  257. !   { "EIGHTEENTH", NTHWORD, 18 },
  258. !   { "NINETEENTH", NTHWORD, 19 },
  259. !   { "ST", ST, 0 },        /* for 1st */
  260. !   { "ND", ND, 0 },        /* 2nd */
  261. !   { "RD", RD, 0 },        /* 3rd */
  262. !   { "TH", TH, 0 },        /* nth */
  263. !   { "AM", AMPM, 0 },        /* time qualifiers */
  264. !   { "A.M.", AMPM, 0 },
  265. !   { "PM", AMPM, 12 },
  266. !   { "P.M.", AMPM, 12 },
  267. !   { "CHRISTMAS", CHRISTMAS, 1225 },    /* special dates */
  268. !   { "NEW", NEW, 101 },
  269. !     /* time zones */
  270. !   { "UT", ZONE, 0 },
  271. !   { "GMT", ZONE, 0 },
  272. !   { "UTC", ZONE, 0 },
  273. !   { "GST", ZONE, -180},
  274. !   { "GDT", ZONE, -120},
  275. !   { "NST", ZONE, -210},
  276. !   { "AST", ZONE, -240},
  277. !   { "ADT", ZONE, -180},
  278. !   { "EST", ZONE, -300 },
  279. !   { "EDT", ZONE, -240 },
  280. !   { "CST", ZONE, -360 },
  281. !   { "CDT", ZONE, -300 },
  282. !   { "MST", ZONE, -420 },
  283. !   { "MDT", ZONE, -360 },
  284. !   { "PST", ZONE, -480 },
  285. !   { "PDT", ZONE, -420 },
  286. !   { "HST", ZONE, -600 },
  287. !   { "HDT", ZONE, -540 },
  288. !   { "AHST", ZONE, -600 },
  289. !   { "AHDT", ZONE, -540 },
  290. !   { "AEST", ZONE, 600 },
  291. !   { "AESST", ZONE, 660 },
  292. !   { "ACST", ZONE, 570 },
  293. !   { "ACSST", ZONE, 630 },
  294. !   { "AWST", ZONE, 480 },
  295. !   { "AWSST", ZONE, 540 },
  296. !   { "EET", ZONE, 120 },
  297. !   { "MET", ZONE, 60 },
  298. !   { "WET", ZONE, 0 },
  299. !   { "BST", ZONE, 60 },
  300. !   { "MEZ", ZONE, 60 },
  301. !   { "MESZ", ZONE, 120 },
  302. !   { "CET", ZONE, 60 },
  303. !   { "CEST", ZONE, 120 },
  304. !     /* military time */
  305. !   { "Z", ZONE, 0 },
  306. !   { "A", ZONE, -60 },
  307. !   { "B", ZONE, -120 },
  308. !   { "C", ZONE, -180 },
  309. !   { "D", ZONE, -240 },
  310. !   { "E", ZONE, -300 },
  311. !   { "F", ZONE, -360 },
  312. !   { "G", ZONE, -420 },
  313. !   { "H", ZONE, -480 },
  314. !   { "I", ZONE, -540 },
  315. ! /* No 'J' -- it's not an accident */
  316. !   { "K", ZONE, -600 },
  317. !   { "L", ZONE, -660 },
  318. !   { "M", ZONE, -720 },
  319. !   { "N", ZONE, 60 },
  320. !   { "O", ZONE, 120 },
  321. !   { "P", ZONE, 180 },
  322. !   { "Q", ZONE, 240 },
  323. !   { "R", ZONE, 300 },
  324. !   { "S", ZONE, 360 },
  325. !   { "T", ZONE, 420 },
  326. !   { "U", ZONE, 480 },
  327. !   { "V", ZONE, 540 },
  328. !   { "W", ZONE, 600 },
  329. !   { "X", ZONE, 660 },
  330. !   { "Y", ZONE, 720 },
  331. !   { 0, 0, 0 }
  332. ! };
  333.   
  334.   %}
  335.   %%
  336. --- 83,89 ----
  337.   /*
  338.    *  Month and week day names (upper case only) and other words.
  339.    */
  340. ! struct stable strings[];
  341.   
  342.   %}
  343.   %%
  344. ***************
  345. *** 1490,1494 ****
  346. --- 1325,1496 ----
  347.       tm = gmtime(gmt);
  348.       tm = localtime(gmt);
  349.   }
  350. + struct stable strings[] =
  351. + {
  352. +   { "JAN*UARY", MONTH, 0 },        /* months (0-11) */
  353. +   { "FEB*RUARY", MONTH, 1 },
  354. +   { "MAR*CH", MONTH, 2 },
  355. +   { "APR*IL", MONTH, 3 },
  356. +   { "MAY", MONTH, 4 },
  357. +   { "JUN*E", MONTH, 5 },
  358. +   { "JUL*Y", MONTH, 6 },
  359. +   { "AUG*UST", MONTH, 7 },
  360. +   { "SEP*TEMBER", MONTH, 8 },
  361. +   { "OCT*OBER", MONTH, 9 },
  362. +   { "NOV*EMBER", MONTH, 10 },
  363. +   { "DEC*EMBER", MONTH, 11 },
  364. +   { "SUN*DAY", WEEKDAY, 0 },    /* days of the week (0-6) */
  365. +   { "MON*DAY", WEEKDAY, 1 },
  366. +   { "TUE*SDAY", WEEKDAY, 2 },
  367. +   { "WED*NESDAY", WEEKDAY, 3 },
  368. +   { "THU*RSDAY", WEEKDAY, 4 },
  369. +   { "FRI*DAY", WEEKDAY, 5 },
  370. +   { "SAT*URDAY", WEEKDAY, 6 },
  371. +   { "YESTERDAY", TODAY, -1 },    /* relative to today */
  372. +   { "TODAY", TODAY, 0 },
  373. +   { "TONIGHT", TONIGHT, 0 },
  374. +   { "NOW", NOW, 0 },
  375. +   { "AGO", AGO, 0 },
  376. +   { "TOMORROW", TODAY, 1 },
  377. +   { "NEXT", NEXT, 0 },        /* keywords */
  378. +   { "THIS", THIS, 0 },
  379. +   { "DAY*S", DAY, 0 },
  380. +   { "WEEK*S", WEEK, 0 },
  381. +   { "MONTH*S", WORD_MONTH, 0 },
  382. +   { "YEAR*S", YEAR, 0 },
  383. +   { "FORTNIGHT", FORTNIGHT, 0 },    /* two weeks (Australian) */
  384. + /*  { "EVERY", EVERY, 0 }, */
  385. +   { "FROM", FROM, 0 },
  386. +   { "AFTER", AFTER, 0 },
  387. +   { "BEFORE", BEFORE, 0 },
  388. +   { "LAST", LAST, 0 },
  389. +   { "THE", THE, 0 },
  390. + /*  { "A", A, 0 }, */
  391. +   { "AT", AT, 0 },
  392. +   { "ON", ON, 0 },
  393. +   { "IN", IN, 0 },
  394. +   { "OF", OF, 0 },
  395. + /*  { "AND", AND, 0 }, */
  396. +   { "MORNING", TIMEKEY, 0 },    /* time keywords. Morning is 0:00 - 11:59 */
  397. +   { "AFTERNOON", TIMEKEY, 12 }, /* Afternoon is 12:00 - 23:59 */
  398. +   { "EVENING", TIMEKEY, 15 },    /* Evening is 15:00 - 02:59 */
  399. +   { "NIGHT", TIMEKEY, 17 },    /* Night is 17:00 - 04:59 */
  400. +   { "NOON", NOON, 12 },        /* time specifications */
  401. +   { "MIDNIGHT", NOON, 24 },
  402. +   { "ONE", NWORD, 1 },        /* numbers up to 19 */
  403. +   { "TWO", NWORD, 2 },
  404. +   { "THREE", NWORD, 3 },
  405. +   { "FOUR", NWORD, 4 },
  406. +   { "FIVE", NWORD, 5 },
  407. +   { "SIX", NWORD, 6 },
  408. +   { "SEVEN", NWORD, 7 },
  409. +   { "EIGHT", NWORD, 8 },
  410. +   { "NINE", NWORD, 9 },
  411. +   { "TEN", NWORD, 10 },
  412. +   { "ELEVEN", NWORD, 11 },
  413. +   { "TWELVE", NWORD, 12 },
  414. +   { "THIRTEEN", NWORD, 13 },
  415. +   { "FOURTEEN", NWORD, 14 },
  416. +   { "FIFTEEN", NWORD, 15 },
  417. +   { "SIXTEEN", NWORD, 16 },
  418. +   { "SEVENTEEN", NWORD, 17 },
  419. +   { "EIGHTEEN", NWORD, 18 },
  420. +   { "NINETEEN", NWORD, 19 },
  421. +   { "FIRST", NTHWORD, 1 },        /* number up to 19th */
  422. +   { "SECOND", NTHWORD, 2 },
  423. +   { "THIRD", NTHWORD, 3 },
  424. +   { "FOURTH", NTHWORD, 4 },
  425. +   { "FIFTH", NTHWORD, 5 },
  426. +   { "SIXTH", NTHWORD, 6 },
  427. +   { "SEVENTH", NTHWORD, 7 },
  428. +   { "EIGHT", NTHWORD, 8 },
  429. +   { "NINTH", NTHWORD, 9 },
  430. +   { "TENTH", NTHWORD, 10 },
  431. +   { "ELEVENTH", NTHWORD, 11 },
  432. +   { "TWELFTH", NTHWORD, 12 },
  433. +   { "THIRTEENTH", NTHWORD, 13 },
  434. +   { "FOURTEENTH", NTHWORD, 14 },
  435. +   { "FIFTEENTH", NTHWORD, 15 },
  436. +   { "SIXTEENTH", NTHWORD, 16 },
  437. +   { "SEVENTEENTH", NTHWORD, 17 },
  438. +   { "EIGHTEENTH", NTHWORD, 18 },
  439. +   { "NINETEENTH", NTHWORD, 19 },
  440. +   { "ST", ST, 0 },        /* for 1st */
  441. +   { "ND", ND, 0 },        /* 2nd */
  442. +   { "RD", RD, 0 },        /* 3rd */
  443. +   { "TH", TH, 0 },        /* nth */
  444. +   { "AM", AMPM, 0 },        /* time qualifiers */
  445. +   { "A.M.", AMPM, 0 },
  446. +   { "PM", AMPM, 12 },
  447. +   { "P.M.", AMPM, 12 },
  448. +   { "CHRISTMAS", CHRISTMAS, 1225 },    /* special dates */
  449. +   { "NEW", NEW, 101 },
  450. +     /* time zones */
  451. +   { "UT", ZONE, 0 },
  452. +   { "GMT", ZONE, 0 },
  453. +   { "UTC", ZONE, 0 },
  454. +   { "GST", ZONE, -180},
  455. +   { "GDT", ZONE, -120},
  456. +   { "NST", ZONE, -210},
  457. +   { "AST", ZONE, -240},
  458. +   { "ADT", ZONE, -180},
  459. +   { "EST", ZONE, -300 },
  460. +   { "EDT", ZONE, -240 },
  461. +   { "CST", ZONE, -360 },
  462. +   { "CDT", ZONE, -300 },
  463. +   { "MST", ZONE, -420 },
  464. +   { "MDT", ZONE, -360 },
  465. +   { "PST", ZONE, -480 },
  466. +   { "PDT", ZONE, -420 },
  467. +   { "HST", ZONE, -600 },
  468. +   { "HDT", ZONE, -540 },
  469. +   { "AHST", ZONE, -600 },
  470. +   { "AHDT", ZONE, -540 },
  471. +   { "AEST", ZONE, 600 },
  472. +   { "AESST", ZONE, 660 },
  473. +   { "ACST", ZONE, 570 },
  474. +   { "ACSST", ZONE, 630 },
  475. +   { "AWST", ZONE, 480 },
  476. +   { "AWSST", ZONE, 540 },
  477. +   { "EET", ZONE, 120 },
  478. +   { "MET", ZONE, 60 },
  479. +   { "WET", ZONE, 0 },
  480. +   { "BST", ZONE, 60 },
  481. +   { "MEZ", ZONE, 60 },
  482. +   { "MESZ", ZONE, 120 },
  483. +   { "CET", ZONE, 60 },
  484. +   { "CEST", ZONE, 120 },
  485. +     /* military time */
  486. +   { "Z", ZONE, 0 },
  487. +   { "A", ZONE, -60 },
  488. +   { "B", ZONE, -120 },
  489. +   { "C", ZONE, -180 },
  490. +   { "D", ZONE, -240 },
  491. +   { "E", ZONE, -300 },
  492. +   { "F", ZONE, -360 },
  493. +   { "G", ZONE, -420 },
  494. +   { "H", ZONE, -480 },
  495. +   { "I", ZONE, -540 },
  496. + /* No 'J' -- it's not an accident */
  497. +   { "K", ZONE, -600 },
  498. +   { "L", ZONE, -660 },
  499. +   { "M", ZONE, -720 },
  500. +   { "N", ZONE, 60 },
  501. +   { "O", ZONE, 120 },
  502. +   { "P", ZONE, 180 },
  503. +   { "Q", ZONE, 240 },
  504. +   { "R", ZONE, 300 },
  505. +   { "S", ZONE, 360 },
  506. +   { "T", ZONE, 420 },
  507. +   { "U", ZONE, 480 },
  508. +   { "V", ZONE, 540 },
  509. +   { "W", ZONE, 600 },
  510. +   { "X", ZONE, 660 },
  511. +   { "Y", ZONE, 720 },
  512. +   { 0, 0, 0 }
  513. + };
  514.   
  515.   #endif NOTDEF
  516. diff -cr --new-file andrew.orig/ams/libs/ms/substr.c andrew/ams/libs/ms/substr.c
  517. *** andrew.orig/ams/libs/ms/substr.c    Fri Jan 24 03:41:20 1992
  518. --- andrew/ams/libs/ms/substr.c    Sat Sep  4 12:06:41 1993
  519. ***************
  520. *** 9,15 ****
  521.   $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/ams/libs/ms/RCS/substr.c,v $
  522.   */
  523.   #include <ms.h>
  524.   char   *
  525.           FindSubString (sub, full)
  526.   char   *sub,
  527. --- 9,17 ----
  528.   $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/ams/libs/ms/RCS/substr.c,v $
  529.   */
  530.   #include <ms.h>
  531. ! #ifndef NULL
  532. ! #define NULL ((void*)0)
  533. ! #endif
  534.   char   *
  535.           FindSubString (sub, full)
  536.   char   *sub,
  537. diff -cr --new-file andrew.orig/atk/apps/runapp.c andrew/atk/apps/runapp.c
  538. *** andrew.orig/atk/apps/runapp.c    Fri Jan 24 03:47:33 1992
  539. --- andrew/atk/apps/runapp.c    Thu Sep  9 14:03:21 1993
  540. ***************
  541. *** 20,27 ****
  542.   
  543.   #include <im.ih>
  544.   #include <app.ih>
  545.   
  546.   extern int errno;
  547.   
  548.   #ifndef RUNAPP
  549. --- 20,29 ----
  550.   
  551.   #include <im.ih>
  552.   #include <app.ih>
  553. + #ifdef linux
  554. + #include <math.h>
  555. + #endif
  556.   
  557.   extern int errno;
  558.   
  559.   #ifndef RUNAPP
  560. ***************
  561. *** 36,41 ****
  562. --- 38,49 ----
  563.       fprintf(stderr,"usage:\t%s [-npdD] {-l classname} appclass args...\n",RUNAPP);
  564.       exit(-1);
  565.   }
  566. + #ifdef linux
  567. + static linux_dummy() 
  568. + {
  569. +     sin(0);
  570. + }
  571. + #endif
  572.   
  573.   static void initClass()
  574.   {
  575. diff -cr --new-file andrew.orig/atk/basics/common/bind.ch andrew/atk/basics/common/bind.ch
  576. *** andrew.orig/atk/basics/common/bind.ch    Fri Jan 24 03:49:27 1992
  577. --- andrew/atk/basics/common/bind.ch    Thu Sep  9 13:18:31 1993
  578. ***************
  579. *** 12,18 ****
  580.   
  581.   struct bind_Description {
  582.       char    *procName;
  583. !     char    *keyVector;
  584.       long    keyRock;
  585.       char    *menuEntry;
  586.       long    menuRock;
  587. --- 12,18 ----
  588.   
  589.   struct bind_Description {
  590.       char    *procName;
  591. !     unsigned char    *keyVector;
  592.       long    keyRock;
  593.       char    *menuEntry;
  594.       long    menuRock;
  595. diff -cr --new-file andrew.orig/atk/basics/common/keymap.c andrew/atk/basics/common/keymap.c
  596. *** andrew.orig/atk/basics/common/keymap.c    Fri Jan 24 03:50:03 1992
  597. --- andrew/atk/basics/common/keymap.c    Thu Sep  9 13:18:31 1993
  598. ***************
  599. *** 90,96 ****
  600.   
  601.   boolean keymap__BindToKey(self, keys, pe, rock)
  602.       struct keymap *self;
  603. !     char *keys;
  604.       struct proctable_Entry *pe;
  605.       long rock;
  606.   {
  607. --- 90,96 ----
  608.   
  609.   boolean keymap__BindToKey(self, keys, pe, rock)
  610.       struct keymap *self;
  611. !     unsigned char *keys;
  612.       struct proctable_Entry *pe;
  613.       long rock;
  614.   {
  615. ***************
  616. *** 103,109 ****
  617.   
  618.   void keymap__RemoveBinding(self,keys)
  619.   struct keymap *self;
  620. ! char *keys;
  621.   {
  622.       bindKey(self,keys,NULL,NULL,keymap_Empty);
  623.   }
  624. --- 103,109 ----
  625.   
  626.   void keymap__RemoveBinding(self,keys)
  627.   struct keymap *self;
  628. ! unsigned char *keys;
  629.   {
  630.       bindKey(self,keys,NULL,NULL,keymap_Empty);
  631.   }
  632. ***************
  633. *** 166,172 ****
  634.   
  635.   enum keymap_Types keymap__Lookup(self, key, object,rockP)
  636.       struct keymap *self;
  637. !     char key;
  638.       struct basicobject **object;
  639.       long *rockP;
  640.   {
  641. --- 166,172 ----
  642.   
  643.   enum keymap_Types keymap__Lookup(self, key, object,rockP)
  644.       struct keymap *self;
  645. !     unsigned char key;
  646.       struct basicobject **object;
  647.       long *rockP;
  648.   {
  649. diff -cr --new-file andrew.orig/atk/basics/common/keymap.ch andrew/atk/basics/common/keymap.ch
  650. *** andrew.orig/atk/basics/common/keymap.ch    Fri Jan 24 03:50:04 1992
  651. --- andrew/atk/basics/common/keymap.ch    Thu Sep  9 13:18:31 1993
  652. ***************
  653. *** 29,35 ****
  654.   
  655.   struct keymap_sparsetable {
  656.       int numValid;
  657. !     char keys[keymap_SPARSESIZE];
  658.       enum keymap_Types types[keymap_SPARSESIZE];
  659.       struct basicobject *objects[keymap_SPARSESIZE];
  660.       long rocks[keymap_SPARSESIZE];
  661. --- 29,35 ----
  662.   
  663.   struct keymap_sparsetable {
  664.       int numValid;
  665. !     unsigned char keys[keymap_SPARSESIZE];
  666.       enum keymap_Types types[keymap_SPARSESIZE];
  667.       struct basicobject *objects[keymap_SPARSESIZE];
  668.       long rocks[keymap_SPARSESIZE];
  669. ***************
  670. *** 43,53 ****
  671.   
  672.   class keymap {
  673.   methods:
  674. !     BindToKey(char *keys, struct proctable_Entry *pe, long rock)    returns boolean;
  675. !     RemoveBinding(char *keys);
  676.       InsertObject(long slot, struct basicobject *object, long rock, enum keymap_Types type);
  677.       /* Lookup stuffs an object in the char * and returns an int that describes its type. */
  678. !     Lookup(char key, struct basicobject **object, long *rockP) returns enum keymap_Types;
  679.   data:
  680.       union {
  681.           struct keymap_sparsetable *sparse;
  682. --- 43,53 ----
  683.   
  684.   class keymap {
  685.   methods:
  686. !     BindToKey(unsigned char *keys, struct proctable_Entry *pe, long rock)    returns boolean;
  687. !     RemoveBinding(unsigned char *keys);
  688.       InsertObject(long slot, struct basicobject *object, long rock, enum keymap_Types type);
  689.       /* Lookup stuffs an object in the char * and returns an int that describes its type. */
  690. !     Lookup(unsigned char key, struct basicobject **object, long *rockP) returns enum keymap_Types;
  691.   data:
  692.       union {
  693.           struct keymap_sparsetable *sparse;
  694. diff -cr --new-file andrew.orig/atk/basics/common/profile.c andrew/atk/basics/common/profile.c
  695. *** andrew.orig/atk/basics/common/profile.c    Fri Jan 24 03:50:40 1992
  696. --- andrew/atk/basics/common/profile.c    Sat Sep  4 13:31:47 1993
  697. ***************
  698. *** 16,28 ****
  699.   /*
  700.    * AIX is SYSVish when it comes to profiling.
  701.    */
  702. ! #ifdef AIX
  703.   #ifndef SYSV
  704.   #define SYSV 1
  705.   #endif /* #ifndef SYSV */
  706.   #endif /* #ifdef AIX */
  707.   
  708. ! #if (!defined(AIX) && !defined(_IBMR2) && !defined(HP300_ENV) && !defined(M_UNIX) && !defined(SGI_4D_ENV))
  709.   #include <sys/gprof.h>
  710.   #endif /* (!defined(AIX) && !defined(_IBMR2) && !defined(HP300_ENV)) */
  711.   
  712. --- 16,28 ----
  713.   /*
  714.    * AIX is SYSVish when it comes to profiling.
  715.    */
  716. ! #if defined(AIX) || defined(linux)
  717.   #ifndef SYSV
  718.   #define SYSV 1
  719.   #endif /* #ifndef SYSV */
  720.   #endif /* #ifdef AIX */
  721.   
  722. ! #if (!defined(AIX) && !defined(_IBMR2) && !defined(HP300_ENV) && !defined(M_UNIX) && !defined(SGI_4D_ENV)) && !defined(linux)
  723.   #include <sys/gprof.h>
  724.   #endif /* (!defined(AIX) && !defined(_IBMR2) && !defined(HP300_ENV)) */
  725.   
  726. diff -cr --new-file andrew.orig/atk/basics/x/xim.c andrew/atk/basics/x/xim.c
  727. *** andrew.orig/atk/basics/x/xim.c    Wed Feb 19 03:52:16 1992
  728. --- andrew/atk/basics/x/xim.c    Sat Sep  4 12:06:42 1993
  729. ***************
  730. *** 68,73 ****
  731. --- 68,79 ----
  732.   
  733.   #include <errprntf.h>
  734.   
  735. + #if defined(linux) || defined(HAVE_STREAMBUF)
  736. + #define FILE_USED(f) ((f)->_egptr - (f)->_gptr)
  737. + #else
  738. + #define FILE_USED(f) ((f)->_cnt)
  739. + #endif
  740.   /* Note this constant also occurs in the cmenus package and in menubar.c */
  741.   #define MAXPANEPRIORITY 100
  742.   
  743. ***************
  744. *** 2993,2999 ****
  745.       while (--nfs>=0)  {
  746.       f = globalFILEHandlers[nfs].file;
  747.       if (f != NULL)  {
  748. !         if (f->_cnt > 0)  {
  749.           ret = TRUE;
  750.           (globalFILEHandlers[nfs].proc)(f, globalFILEHandlers[nfs].procdata);
  751.           }
  752. --- 2999,3005 ----
  753.       while (--nfs>=0)  {
  754.       f = globalFILEHandlers[nfs].file;
  755.       if (f != NULL)  {
  756. !         if (FILE_USED(f) > 0)  {
  757.           ret = TRUE;
  758.           (globalFILEHandlers[nfs].proc)(f, globalFILEHandlers[nfs].procdata);
  759.           }
  760. diff -cr --new-file andrew.orig/atk/bush/bush.c andrew/atk/bush/bush.c
  761. *** andrew.orig/atk/bush/bush.c    Fri Jan 24 03:51:12 1992
  762. --- andrew/atk/bush/bush.c    Sat Sep  4 12:06:42 1993
  763. ***************
  764. *** 749,755 ****
  765.   #endif /* SY_AIX12 && !hpux */
  766.       register int    fd;
  767.   
  768. ! #ifdef SGI_4D_ENV
  769.       getpgrp();
  770.   #else
  771.       setpgrp(0,pid = getpid());
  772. --- 749,755 ----
  773.   #endif /* SY_AIX12 && !hpux */
  774.       register int    fd;
  775.   
  776. ! #if defined(SGI_4D_ENV) || defined(linux)
  777.       getpgrp();
  778.   #else
  779.       setpgrp(0,pid = getpid());
  780. diff -cr --new-file andrew.orig/atk/console/lib/input.c andrew/atk/console/lib/input.c
  781. *** andrew.orig/atk/console/lib/input.c    Fri Jan 24 03:53:25 1992
  782. --- andrew/atk/console/lib/input.c    Sat Sep  4 11:09:07 1993
  783. ***************
  784. *** 38,44 ****
  785.   #include <console.h>
  786.   #include <convers.h>
  787.   #include <andrewos.h> /* sys/types.h sys/time.h */
  788. ! #ifdef M_UNIX
  789.   #include <dirent.h>
  790.   #define direct dirent
  791.   #define namlen(d) (strlen((d)->d_name))
  792. --- 38,44 ----
  793.   #include <console.h>
  794.   #include <convers.h>
  795.   #include <andrewos.h> /* sys/types.h sys/time.h */
  796. ! #if defined(M_UNIX) || defined(linux)
  797.   #include <dirent.h>
  798.   #define direct dirent
  799.   #define namlen(d) (strlen((d)->d_name))
  800. diff -cr --new-file andrew.orig/atk/console/lib/mailmonf.c andrew/atk/console/lib/mailmonf.c
  801. *** andrew.orig/atk/console/lib/mailmonf.c    Fri Jan 24 03:53:28 1992
  802. --- andrew/atk/console/lib/mailmonf.c    Sat Sep  4 11:18:47 1993
  803. ***************
  804. *** 20,26 ****
  805.   #include <conclass.ih>
  806.   #include <console.h>
  807.   #include <sys/param.h>
  808. ! #ifdef M_UNIX
  809.   #include <dirent.h>
  810.   #define direct dirent
  811.   #define namlen(d) (strlen((d)->d_name))
  812. --- 20,26 ----
  813.   #include <conclass.ih>
  814.   #include <console.h>
  815.   #include <sys/param.h>
  816. ! #if defined(M_UNIX) || defined(linux)
  817.   #include <dirent.h>
  818.   #define direct dirent
  819.   #define namlen(d) (strlen((d)->d_name))
  820. diff -cr --new-file andrew.orig/atk/console/lib/setup.c andrew/atk/console/lib/setup.c
  821. *** andrew.orig/atk/console/lib/setup.c    Fri Jan 24 03:53:33 1992
  822. --- andrew/atk/console/lib/setup.c    Sat Sep  4 12:06:43 1993
  823. ***************
  824. *** 42,48 ****
  825.   #include <sys/wait.h>
  826.   #endif /* hp9000s300 */
  827.   #include <sitevars.h>
  828.   #ifdef hpux
  829.   #define killpg(id,sig) kill(-(id),sig)
  830.   #endif /* hpux */
  831. --- 42,50 ----
  832.   #include <sys/wait.h>
  833.   #endif /* hp9000s300 */
  834.   #include <sitevars.h>
  835. ! #ifdef linux
  836. ! #include <bsd/signal.h>
  837. ! #endif
  838.   #ifdef hpux
  839.   #define killpg(id,sig) kill(-(id),sig)
  840.   #endif /* hpux */
  841. ***************
  842. *** 1416,1422 ****
  843. --- 1418,1428 ----
  844.                       if (*newchild == -1)
  845.                           newchild[1] = -1;
  846.                       if ((*newchild = osi_vfork()) == 0) {
  847. + #if defined(linux)
  848. +                         setpgrp();
  849. + #else
  850.                           setpgrp(0, getpid());
  851. + #endif
  852.                           execl(_SITE_BIN_SH, "sh", "-c", TokenBuf, 0);
  853.                           _exit(0);
  854.                       }
  855. ***************
  856. *** 1969,1974 ****
  857. --- 1975,1983 ----
  858.   #if defined(hpux) || defined(M_UNIX)
  859.       setpgrp(); /* breaks process group affiliation of controlling terminal */
  860.   #else /* hpux */
  861. + #ifdef POSIX_ENV
  862. +     setsid();
  863. + #else /* posix */
  864.       /* Grubby fix for wm startup bug, courtesy of Bruce Lucas */
  865.       fd=open(_SITE_DEV_TTY, 2);
  866.       if (fd>=0) {
  867. ***************
  868. *** 1975,1980 ****
  869. --- 1984,1990 ----
  870.       ioctl(fd, TIOCNOTTY, 0);
  871.       close(fd);
  872.       }
  873. + #endif /* posix */
  874.   #endif /* hpux */
  875.   #ifdef SIGXFSZ
  876.       signal(SIGXFSZ, ToggleDebugging);
  877. diff -cr --new-file andrew.orig/atk/console/lib/vmmon.c andrew/atk/console/lib/vmmon.c
  878. *** andrew.orig/atk/console/lib/vmmon.c    Fri Jan 24 03:53:41 1992
  879. --- andrew/atk/console/lib/vmmon.c    Sat Sep  4 12:06:43 1993
  880. ***************
  881. *** 73,79 ****
  882. --- 73,83 ----
  883.       if ((*newchild = osi_vfork()) == 0) {
  884.       /* since the pid is 0, then all calls apply to this process group */
  885.                   theGetstatsPid = getpid();
  886. + #ifdef linux
  887. +     setpgrp();
  888. + #else
  889.       setpgrp(0, theGetstatsPid);
  890. + #endif
  891.       /* 1 == stdout */
  892.       if (dup2 (pfds[1], 1) == -1){ 
  893.           perror("console: dup2 failed while forking getstats\n");
  894. ***************
  895. *** 83,89 ****
  896.           perror("console:<child> close of pfds[0] failed\n");
  897.       }
  898.       if (close (pfds[1]) == -1){
  899. !         perror(self, "console: close of pfds[1] failed\n");
  900.       }
  901.       myargv[0] = "getstats";
  902.       sprintf(userid, "%d", getuid());
  903. --- 87,93 ----
  904.           perror("console:<child> close of pfds[0] failed\n");
  905.       }
  906.       if (close (pfds[1]) == -1){
  907. !         perror("console: close of pfds[1] failed\n");
  908.       }
  909.       myargv[0] = "getstats";
  910.       sprintf(userid, "%d", getuid());
  911. diff -cr --new-file andrew.orig/atk/console/stats/i386_linux/Imakefile andrew/atk/console/stats/i386_linux/Imakefile
  912. *** andrew.orig/atk/console/stats/i386_linux/Imakefile
  913. --- andrew/atk/console/stats/i386_linux/Imakefile    Mon Sep  6 19:30:41 1993
  914. ***************
  915. *** 0 ****
  916. --- 1,22 ----
  917. + /* ********************************************************************** *\
  918. +  *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
  919. +  *        For full copyright information see:'andrew/config/COPYRITE'     *
  920. + \* ********************************************************************** */
  921. + LOCALINCLUDES = -I../../lib
  922. + DependTarget()
  923. + NormalObjectRule()
  924. + LibraryTarget(libgs.a, getstats.o)
  925. + /* ********************************************************************** *\
  926. +  *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
  927. +  *        For full copyright information see:'andrew/config/COPYRITE'     *
  928. + \* ********************************************************************** */
  929. + LOCALINCLUDES = -I../../lib
  930. + DependTarget()
  931. + NormalObjectRule()
  932. + LibraryTarget(libgs.a, getstats.o)
  933. diff -cr --new-file andrew.orig/atk/console/stats/i386_linux/getstats.c andrew/atk/console/stats/i386_linux/getstats.c
  934. *** andrew.orig/atk/console/stats/i386_linux/getstats.c
  935. --- andrew/atk/console/stats/i386_linux/getstats.c    Mon Sep  6 19:30:41 1993
  936. ***************
  937. *** 0 ****
  938. --- 1,156 ----
  939. + /* ********************************************************************** *\
  940. +  *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
  941. +  *        For full copyright information see:'andrew/config/COPYRITE'     *
  942. + \* ********************************************************************** */
  943. + static char *getstats_rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v 1.2 1991/09/12 16:08:39 bobg Exp $";
  944. + /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v 1.2 1991/09/12 16:08:39 bobg Exp $ */
  945. + /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v $ */
  946. + #ifndef lint
  947. + static char *getstats_c_id = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v 1.2 1991/09/12 16:08:39 bobg Exp $";
  948. + #endif /* lint */
  949. + /* **********************************************************************
  950. + *   ****************
  951. + *   STUB LIBRARY FILE---NOT YET IMPLEMENTED FOR THIS SYSTEM
  952. + *   THIS CODE SHOULD BE REPLACED BY AN IMPLEMENTATION OF
  953. + *   THE RELEVANT ROUTINES FOR YOUR MACHINE TYPE.
  954. + *   Please contribute your implementations to info-andrew-bugs@andrew.cmu.edu.
  955. + *   You may use any of the other ../<several>/getstats.c files as templates.
  956. + *   ****************
  957. + *
  958. + *   This code is designed to read what might be priveledged (setuid) 
  959. + *   information regarding both Disk Statistics (% full) and a host of 
  960. + *   stats from /dev/kmem (including but not limited to, CPU, I/O, and VM)
  961. + *
  962. + *   When retriving the data - this program will print out to stdout
  963. + *   a string in the form of either "%d:%d\n" or "%d:%d:%s\n"
  964. + *   The latter case is for passing the name of where a disk is mounted
  965. + *   back to the parent program.
  966. + *
  967. + *   The parent program (Console, or any other program which wishes to get
  968. + *   at this information) is responsible for setting up a pipe, binding the
  969. + *   child's (this program) stdout to one end of a pipe, and parsing the
  970. + *   strings which are passed back.
  971. + *
  972. + *   The basic string format is an ID (int), a colon, a value (int), and
  973. + *   optionally another colon followed by a string.  The ID is coded from
  974. + *   the included file "getstats.h" - ID values 50 and over represent 
  975. + *   ERRORS as documented in the above mentioned inclued file.  When an 
  976. + *   ERROR or the optional string is passed, the value (second parameter)
  977. + *   can be safely ignored, and is usually set to 0.
  978. + *
  979. + *   The arguments to be passed to this program are the effective UID from
  980. + *   the parent program, a polling frequency (# of seconds) for checking
  981. + *   /dev/kmem (usually between 1 and 5, must be > 0), and a polling
  982. + *   frequency for checking how full the local disks are (generally higher
  983. + *   than the value for /dev/kmem, but could vary greatly).  Thus the call
  984. + *   is:
  985. + *
  986. + *   execvp("getstats", argv)
  987. + *
  988. + *   with argv as:
  989. + *
  990. + *   argv[0]="getstats";
  991. + *   argv[1]=~ ("%d", UID);
  992. + *   argv[2]=~ ("%d", kmempollfrequency);
  993. + *   argv[3]=~ ("%d", diskpollfrequency);
  994. + *   argv[4]=NULL;
  995. + *
  996. + ********************************************************************** */
  997. + #include <sitevars.h>
  998. + #include <system.h>
  999. + GetGVMStats(UsersID)
  1000. + int UsersID;
  1001. + {
  1002. + }
  1003. + InitGVMStats()
  1004. + {
  1005. + }
  1006. + GetDiskStats(Init)
  1007. + int Init;
  1008. + {
  1009. + }
  1010. + /* ********************************************************************** *\
  1011. +  *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
  1012. +  *        For full copyright information see:'andrew/config/COPYRITE'     *
  1013. + \* ********************************************************************** */
  1014. + static char *getstats_rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v 1.2 1991/09/12 16:08:39 bobg Exp $";
  1015. + /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v 1.2 1991/09/12 16:08:39 bobg Exp $ */
  1016. + /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v $ */
  1017. + #ifndef lint
  1018. + static char *getstats_c_id = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v 1.2 1991/09/12 16:08:39 bobg Exp $";
  1019. + #endif /* lint */
  1020. + /* **********************************************************************
  1021. + *   ****************
  1022. + *   STUB LIBRARY FILE---NOT YET IMPLEMENTED FOR THIS SYSTEM
  1023. + *   THIS CODE SHOULD BE REPLACED BY AN IMPLEMENTATION OF
  1024. + *   THE RELEVANT ROUTINES FOR YOUR MACHINE TYPE.
  1025. + *   Please contribute your implementations to info-andrew-bugs@andrew.cmu.edu.
  1026. + *   You may use any of the other ../<several>/getstats.c files as templates.
  1027. + *   ****************
  1028. + *
  1029. + *   This code is designed to read what might be priveledged (setuid) 
  1030. + *   information regarding both Disk Statistics (% full) and a host of 
  1031. + *   stats from /dev/kmem (including but not limited to, CPU, I/O, and VM)
  1032. + *
  1033. + *   When retriving the data - this program will print out to stdout
  1034. + *   a string in the form of either "%d:%d\n" or "%d:%d:%s\n"
  1035. + *   The latter case is for passing the name of where a disk is mounted
  1036. + *   back to the parent program.
  1037. + *
  1038. + *   The parent program (Console, or any other program which wishes to get
  1039. + *   at this information) is responsible for setting up a pipe, binding the
  1040. + *   child's (this program) stdout to one end of a pipe, and parsing the
  1041. + *   strings which are passed back.
  1042. + *
  1043. + *   The basic string format is an ID (int), a colon, a value (int), and
  1044. + *   optionally another colon followed by a string.  The ID is coded from
  1045. + *   the included file "getstats.h" - ID values 50 and over represent 
  1046. + *   ERRORS as documented in the above mentioned inclued file.  When an 
  1047. + *   ERROR or the optional string is passed, the value (second parameter)
  1048. + *   can be safely ignored, and is usually set to 0.
  1049. + *
  1050. + *   The arguments to be passed to this program are the effective UID from
  1051. + *   the parent program, a polling frequency (# of seconds) for checking
  1052. + *   /dev/kmem (usually between 1 and 5, must be > 0), and a polling
  1053. + *   frequency for checking how full the local disks are (generally higher
  1054. + *   than the value for /dev/kmem, but could vary greatly).  Thus the call
  1055. + *   is:
  1056. + *
  1057. + *   execvp("getstats", argv)
  1058. + *
  1059. + *   with argv as:
  1060. + *
  1061. + *   argv[0]="getstats";
  1062. + *   argv[1]=~ ("%d", UID);
  1063. + *   argv[2]=~ ("%d", kmempollfrequency);
  1064. + *   argv[3]=~ ("%d", diskpollfrequency);
  1065. + *   argv[4]=NULL;
  1066. + *
  1067. + ********************************************************************** */
  1068. + #include <sitevars.h>
  1069. + #include <system.h>
  1070. + GetGVMStats(UsersID)
  1071. + int UsersID;
  1072. + {
  1073. + }
  1074. + InitGVMStats()
  1075. + {
  1076. + }
  1077. + GetDiskStats(Init)
  1078. + int Init;
  1079. + {
  1080. + }
  1081. diff -cr --new-file andrew.orig/atk/controllers/helpcon.c andrew/atk/controllers/helpcon.c
  1082. *** andrew.orig/atk/controllers/helpcon.c    Fri Jan 24 03:52:33 1992
  1083. --- andrew/atk/controllers/helpcon.c    Sat Sep  4 11:05:11 1993
  1084. ***************
  1085. *** 15,21 ****
  1086.   #include "proctbl.ih"
  1087.   #include "view.ih"
  1088.   #include "arbiterv.ih"
  1089. ! #ifdef M_UNIX
  1090.   #include <dirent.h>
  1091.   #define direct dirent
  1092.   #else
  1093. --- 15,21 ----
  1094.   #include "proctbl.ih"
  1095.   #include "view.ih"
  1096.   #include "arbiterv.ih"
  1097. ! #if defined(M_UNIX) || defined(linux)
  1098.   #include <dirent.h>
  1099.   #define direct dirent
  1100.   #else
  1101. diff -cr --new-file andrew.orig/atk/extensions/compile.c andrew/atk/extensions/compile.c
  1102. *** andrew.orig/atk/extensions/compile.c    Fri Jan 24 03:59:47 1992
  1103. --- andrew/atk/extensions/compile.c    Sat Sep  4 12:06:43 1993
  1104. ***************
  1105. *** 156,162 ****
  1106.           for (fd = 3; fd < numfds; fd++)
  1107.               close(fd);
  1108.   
  1109. ! #if defined(hpux) || defined(SGI_4D_ENV)
  1110.       setpgrp();
  1111.   #else /* hpux */
  1112.           setpgrp(0, getpid());
  1113. --- 156,162 ----
  1114.           for (fd = 3; fd < numfds; fd++)
  1115.               close(fd);
  1116.   
  1117. ! #if defined(hpux) || defined(SGI_4D_ENV) || defined(linux)
  1118.       setpgrp();
  1119.   #else /* hpux */
  1120.           setpgrp(0, getpid());
  1121. diff -cr --new-file andrew.orig/atk/extensions/ezdiff.c andrew/atk/extensions/ezdiff.c
  1122. *** andrew.orig/atk/extensions/ezdiff.c    Fri Jan 24 03:59:57 1992
  1123. --- andrew/atk/extensions/ezdiff.c    Sat Sep  4 12:06:43 1993
  1124. ***************
  1125. *** 29,34 ****
  1126. --- 29,38 ----
  1127.   #include <cursor.ih>
  1128.   #include <ezdiff.eh>
  1129.   
  1130. + #ifdef linux
  1131. + #include <sys/wait.h>
  1132. + #endif
  1133.   #define ObjectOf(V) (((struct view *)(V))->dataobject)
  1134.   #define USECURRENTMARK -32000l
  1135.   struct ezdiff *firstlink , *lastlink;
  1136. ***************
  1137. *** 208,218 ****
  1138.       _exit(4);
  1139.       }
  1140.       wait(&status);
  1141. - #ifdef hpux
  1142. -     switch((((int)status >>8)&0377)){
  1143.   
  1144.   #else /* hpux */
  1145.       switch(status.w_T.w_Retcode){
  1146.   #endif /* hpux */
  1147.       case 0: /* No Differences */
  1148.           message_DisplayString(NULL,0,"Files are identical");
  1149. --- 212,226 ----
  1150.       _exit(4);
  1151.       }
  1152.       wait(&status);
  1153.   
  1154. + #if defined(hpux)
  1155. +     switch((((int)status >>8)&0377)){
  1156.   #else /* hpux */
  1157. + #ifdef linux
  1158. +     switch(WEXITSTATUS(status)){
  1159. + #else
  1160.       switch(status.w_T.w_Retcode){
  1161. + #endif
  1162.   #endif /* hpux */
  1163.       case 0: /* No Differences */
  1164.           message_DisplayString(NULL,0,"Files are identical");
  1165. diff -cr --new-file andrew.orig/atk/extensions/spell.c andrew/atk/extensions/spell.c
  1166. *** andrew.orig/atk/extensions/spell.c    Fri Jan 24 04:00:09 1992
  1167. --- andrew/atk/extensions/spell.c    Sat Sep  4 12:06:44 1993
  1168. ***************
  1169. *** 91,97 ****
  1170.           for (fd = 3; fd < numfds; fd++)
  1171.               close(fd);
  1172.   
  1173. ! #if defined(SGI_4D_ENV)
  1174.       setpgrp();
  1175.   #else
  1176.           setpgrp(0, getpid());
  1177. --- 91,97 ----
  1178.           for (fd = 3; fd < numfds; fd++)
  1179.               close(fd);
  1180.   
  1181. ! #if defined(SGI_4D_ENV) || defined(linux)
  1182.       setpgrp();
  1183.   #else
  1184.           setpgrp(0, getpid());
  1185. diff -cr --new-file andrew.orig/atk/fad/fadv.c andrew/atk/fad/fadv.c
  1186. *** andrew.orig/atk/fad/fadv.c    Fri Jan 24 04:00:34 1992
  1187. --- andrew/atk/fad/fadv.c    Sat Sep  4 12:06:44 1993
  1188. ***************
  1189. *** 10,15 ****
  1190. --- 10,21 ----
  1191.   static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/fad/RCS/fadv.c,v 2.14 1991/09/12 16:21:00 bobg Exp $";
  1192.   #endif /* lint */
  1193.   
  1194. + #if defined(linux) || defined(HAVE_STREAMBUF)
  1195. + #define FILE_USED(f) ((f)->_egptr - (f)->_gptr)
  1196. + #else
  1197. + #define FILE_USED(f) ((f)->_cnt)
  1198. + #endif
  1199.   #include <andrewos.h> /* sys/time.h sys/types.h */
  1200.   #include <sys/stat.h>
  1201.   #include <class.h>
  1202. ***************
  1203. *** 1144,1150 ****
  1204.       while(( c = getc(f))!= EOF){
  1205.       if(c == NULL) break;
  1206.       fad_setpoint(cpic, fad_iconnum(cpic,cpic->cfname), c,NEW,self->f);
  1207. !     if(f->_cnt == 0) break;
  1208.       }
  1209.       if(c == EOF){
  1210.       if(cpic->iconpointend == cpic->iconpoints)
  1211. --- 1150,1156 ----
  1212.       while(( c = getc(f))!= EOF){
  1213.       if(c == NULL) break;
  1214.       fad_setpoint(cpic, fad_iconnum(cpic,cpic->cfname), c,NEW,self->f);
  1215. !     if(FILE_USED(f) == 0) break;
  1216.       }
  1217.       if(c == EOF){
  1218.       if(cpic->iconpointend == cpic->iconpoints)
  1219. diff -cr --new-file andrew.orig/atk/frame/framecmd.c andrew/atk/frame/framecmd.c
  1220. *** andrew.orig/atk/frame/framecmd.c    Fri Jan 24 04:00:43 1992
  1221. --- andrew/atk/frame/framecmd.c    Sat Sep  4 12:06:44 1993
  1222. ***************
  1223. *** 86,92 ****
  1224. --- 86,94 ----
  1225.           return FALSE;    /* too small an integer to be a pointer (in ATK) */
  1226.   
  1227.       /* now be sure we can fetch from the location */
  1228. + #ifdef SIGBUS
  1229.       oldBus = signal(SIGBUS, SigHandler);
  1230. + #endif
  1231.       oldSeg = signal(SIGSEGV, SigHandler);
  1232.       if (setjmp(trap) != 0) 
  1233.           /* return here from longjmp */
  1234. ***************
  1235. *** 93,100 ****
  1236.           c = '\1';    /* not a legal string */
  1237.       else 
  1238.           /* normal setjmp return location */
  1239. !         c = *arg;        /* this could fail if arg were not a pointer */
  1240.       signal(SIGBUS, oldBus);
  1241.       signal(SIGSEGV, oldSeg);
  1242.   
  1243.       /* return value depending on whether it points to an ASCII printable character */
  1244. --- 95,105 ----
  1245.           c = '\1';    /* not a legal string */
  1246.       else 
  1247.           /* normal setjmp return location */
  1248. !         c = *arg;        /* this could fail if arg were */
  1249. !                     /* not a pointer */
  1250. ! #ifdef SIGBUS
  1251.       signal(SIGBUS, oldBus);
  1252. + #endif
  1253.       signal(SIGSEGV, oldSeg);
  1254.   
  1255.       /* return value depending on whether it points to an ASCII printable character */
  1256. diff -cr --new-file andrew.orig/atk/help/src/helpdb.c andrew/atk/help/src/helpdb.c
  1257. *** andrew.orig/atk/help/src/helpdb.c    Fri Jan 24 04:01:19 1992
  1258. --- andrew/atk/help/src/helpdb.c    Sat Sep  4 11:17:11 1993
  1259. ***************
  1260. *** 37,43 ****
  1261.   #include <stdio.h>
  1262.   #include <errno.h>
  1263.   #include <ctype.h>
  1264. ! #ifdef M_UNIX
  1265.   #include <dirent.h>
  1266.   #define direct dirent
  1267.   #define namlen(d) (strlen((d)->d_name))
  1268. --- 37,43 ----
  1269.   #include <stdio.h>
  1270.   #include <errno.h>
  1271.   #include <ctype.h>
  1272. ! #if defined(M_UNIX) || defined(linux)
  1273.   #include <dirent.h>
  1274.   #define direct dirent
  1275.   #define namlen(d) (strlen((d)->d_name))
  1276. diff -cr --new-file andrew.orig/atk/layout/boxview.c andrew/atk/layout/boxview.c
  1277. *** andrew.orig/atk/layout/boxview.c    Fri Jan 24 04:01:54 1992
  1278. --- andrew/atk/layout/boxview.c    Sun Sep  5 10:56:55 1993
  1279. ***************
  1280. *** 16,21 ****
  1281. --- 16,24 ----
  1282.   #ifndef _IBMR2
  1283.   extern char *malloc();
  1284.   #endif /* _IBMR2 */
  1285. + #ifdef linux
  1286. + #define NDEBUG
  1287. + #endif
  1288.   
  1289.   #include <class.h>
  1290.   #include <assert.h>
  1291. diff -cr --new-file andrew.orig/atk/layout/fillerv.c andrew/atk/layout/fillerv.c
  1292. *** andrew.orig/atk/layout/fillerv.c    Fri Jan 24 04:01:55 1992
  1293. --- andrew/atk/layout/fillerv.c    Sun Sep  5 10:53:49 1993
  1294. ***************
  1295. *** 21,26 ****
  1296. --- 21,30 ----
  1297.   extern char *realloc();
  1298.   #endif /* _IBMR2 */
  1299.   
  1300. + #ifdef linux
  1301. + #define NDEBUG
  1302. + #endif
  1303.   #include <class.h>
  1304.   #include <assert.h>
  1305.   
  1306. diff -cr --new-file andrew.orig/atk/ness/objects/call.c andrew/atk/ness/objects/call.c
  1307. *** andrew.orig/atk/ness/objects/call.c    Fri Mar 13 04:13:58 1992
  1308. --- andrew/atk/ness/objects/call.c    Sun Sep  5 11:10:36 1993
  1309. ***************
  1310. *** 18,24 ****
  1311. --- 18,31 ----
  1312.   #include <ctype.h>
  1313.   #include <sys/param.h>
  1314.   #include <sys/types.h>
  1315. + #if defined(M_UNIX) || defined(linux)
  1316. + #include <dirent.h>
  1317. + #define direct dirent
  1318. + #define namlen(d) (strlen((d)->d_name))
  1319. + #else
  1320.   #include <sys/dir.h>
  1321. + #define namlen(d) ((d)->d_namlen)
  1322. + #endif
  1323.   
  1324.   #include <filetype.ih>
  1325.   #include <environ.ih>
  1326. ***************
  1327. *** 1486,1502 ****
  1328.           struct nesssym *s;
  1329.           boolean new;
  1330.   
  1331. !         t = (unsigned char *)(entry->d_name + entry->d_namlen);
  1332.           if (*(t-2) != '.' ||  *(t-1) != 'n')
  1333.               /* skip all files other than *.n */
  1334.               continue;
  1335. !         fname = (unsigned char *)malloc(entry->d_namlen+1);
  1336. !         symname = (unsigned char *)malloc(entry->d_namlen+1);
  1337. !         strncpy(fname, entry->d_name, entry->d_namlen);
  1338. !         fname[entry->d_namlen] = '\0';
  1339.           /* build symbol name */
  1340.           strcpy(symname, fname);
  1341. !         symname[entry->d_namlen-2] = '\0';    /* remove .n */
  1342.           for (t=symname; *t; t++)        /* smash case */
  1343.               if (isupper(*t)) *t = tolower(*t);
  1344.           s = nesssym_NLocate(symname, proto, LibScope, &new);
  1345. --- 1493,1509 ----
  1346.           struct nesssym *s;
  1347.           boolean new;
  1348.   
  1349. !         t = (unsigned char *)(entry->d_name + namlen(entry));
  1350.           if (*(t-2) != '.' ||  *(t-1) != 'n')
  1351.               /* skip all files other than *.n */
  1352.               continue;
  1353. !         fname = (unsigned char *)malloc(namlen(entry)+1);
  1354. !         symname = (unsigned char *)malloc(namlen(entry)+1);
  1355. !         strncpy(fname, entry->d_name, namlen(entry));
  1356. !         fname[namlen(entry)] = '\0';
  1357.           /* build symbol name */
  1358.           strcpy(symname, fname);
  1359. !         symname[namlen(entry)-2] = '\0';    /* remove .n */
  1360.           for (t=symname; *t; t++)        /* smash case */
  1361.               if (isupper(*t)) *t = tolower(*t);
  1362.           s = nesssym_NLocate(symname, proto, LibScope, &new);
  1363. ***************
  1364. *** 1646,1652 ****
  1365.       under = (unsigned char *)index(fun, '_');
  1366.       if (under == NULL)
  1367.           return NotRead;   /* not valid library function name */
  1368. !     nmlen = MIN(MAXNAMLEN, under - fun);
  1369.       strncpy(fname, fun, nmlen);
  1370.       fname[nmlen] = '\0';
  1371.       libsym = nesssym_NFind(fname, LibScope);
  1372. --- 1653,1659 ----
  1373.       under = (unsigned char *)index(fun, '_');
  1374.       if (under == NULL)
  1375.           return NotRead;   /* not valid library function name */
  1376. !     nmlen = (MAXNAMLEN > under - fun) ? ( under - fun ) : MAXNAMLEN;
  1377.       strncpy(fname, fun, nmlen);
  1378.       fname[nmlen] = '\0';
  1379.       libsym = nesssym_NFind(fname, LibScope);
  1380. diff -cr --new-file andrew.orig/atk/ness/objects/interp.c andrew/atk/ness/objects/interp.c
  1381. *** andrew.orig/atk/ness/objects/interp.c    Fri Mar 13 04:14:03 1992
  1382. --- andrew/atk/ness/objects/interp.c    Sun Sep  5 10:59:44 1993
  1383. ***************
  1384. *** 629,635 ****
  1385. --- 629,637 ----
  1386.           }
  1387.   
  1388.           /* restore error traps */
  1389. + #ifdef SIGBUS
  1390.           signal(SIGBUS, oldBus);
  1391. + #endif
  1392.           signal(SIGSEGV, oldSeg);
  1393.   
  1394.           /* restore global variables */
  1395. ***************
  1396. *** 655,661 ****
  1397. --- 657,665 ----
  1398.       /* when first called setjmp returns zero so execution initially continues here */
  1399.   
  1400.       /* catch disasterous errors */
  1401. + #ifdef SIGBUS
  1402.       oldBus = (int (*)())signal(SIGBUS, SigHandler);
  1403. + #endif
  1404.       oldSeg = (int (*)())signal(SIGSEGV, SigHandler);
  1405.   
  1406.   while (TRUE)  {
  1407. diff -cr --new-file andrew.orig/atk/ness/objects/real.c andrew/atk/ness/objects/real.c
  1408. *** andrew.orig/atk/ness/objects/real.c    Fri Jan 24 04:03:32 1992
  1409. --- andrew/atk/ness/objects/real.c    Sun Sep  5 11:12:50 1993
  1410. ***************
  1411. *** 101,106 ****
  1412. --- 101,111 ----
  1413.           case 'b':    NSP->d.v = acosh(NSP->d.v);   break;
  1414.           case 'd':    NSP->d.v = asinh(NSP->d.v);   break;
  1415.           case 'f':    NSP->d.v = atanh(NSP->d.v);   break;
  1416. + #ifdef linux
  1417. + #define log1p(x) (log(1.0 + (x)))
  1418. + #define expm1(x) (exp((x)) - 1.0)
  1419. + #define cbrt(x) (pow((x), 1.0/3.0))
  1420. + #endif
  1421.           case 'g':    NSP->d.v = cbrt(NSP->d.v);    break;
  1422.           case 'n':    NSP->d.v = expm1(NSP->d.v);   break;
  1423.           case 'w':    NSP->d.v = log1p(NSP->d.v);   break;
  1424. diff -cr --new-file andrew.orig/atk/ness/type/err.c andrew/atk/ness/type/err.c
  1425. *** andrew.orig/atk/ness/type/err.c    Fri Jan 24 04:02:43 1992
  1426. --- andrew/atk/ness/type/err.c    Sun Sep  5 10:58:25 1993
  1427. ***************
  1428. *** 39,45 ****
  1429. --- 39,47 ----
  1430.   
  1431.   _err_LookAhead()
  1432.   {
  1433. + #ifdef SIGBUS
  1434.       signal(SIGBUS, err_HandleSignal);
  1435. + #endif
  1436.       signal(SIGSEGV, err_HandleSignal);
  1437.   }
  1438.   
  1439. ***************
  1440. *** 46,51 ****
  1441. --- 48,55 ----
  1442.   void
  1443.   err_MarkEnd()
  1444.   {
  1445. + #ifdef SIGBUS
  1446.       signal(SIGBUS, SIG_DFL);
  1447. + #endif
  1448.       signal(SIGSEGV, SIG_DFL);
  1449.   }
  1450. diff -cr --new-file andrew.orig/atk/preview/preview.c andrew/atk/preview/preview.c
  1451. *** andrew.orig/atk/preview/preview.c    Fri Jan 24 04:04:41 1992
  1452. --- andrew/atk/preview/preview.c    Sun Sep  5 10:52:30 1993
  1453. ***************
  1454. *** 38,43 ****
  1455. --- 38,50 ----
  1456.   #include <message.ih>
  1457.   #endif /* USEFRAME */
  1458.   
  1459. + #if defined(linux) || defined(HAVE_STREAMBUF)
  1460. + #define FILE_USED(f) ((f)->_egptr - (f)->_gptr)
  1461. + #else
  1462. + #define FILE_USED(f) ((f)->_cnt)
  1463. + #endif
  1464.   #define ResetOffsets(self) if(! self->DoScaling ) self->yoff = self->xoff = 0;
  1465.   static SetTitle(self)
  1466.   struct preview *self;
  1467. ***************
  1468. *** 447,453 ****
  1469.        FilePosition += 1;
  1470.        if (self->SizeChanged)
  1471.           break;
  1472. !      if (filein->_cnt <= 0 && !self->DviFileComplete)
  1473.           break;
  1474.         }
  1475.      self->lastc = lastc;
  1476. --- 454,460 ----
  1477.        FilePosition += 1;
  1478.        if (self->SizeChanged)
  1479.           break;
  1480. !      if (FILE_USED(filein) <= 0 && !self->DviFileComplete)
  1481.           break;
  1482.         }
  1483.      self->lastc = lastc;
  1484. ***************
  1485. *** 748,754 ****
  1486.      /* To avoid dieing when the parent quits; reset process
  1487.       group id; set it to processid to be unique */
  1488.      processid = getpid();
  1489. ! #ifdef hpux
  1490.      setpgrp();
  1491.   #else /* hpux */
  1492.      setpgrp(0,processid);
  1493. --- 755,761 ----
  1494.      /* To avoid dieing when the parent quits; reset process
  1495.       group id; set it to processid to be unique */
  1496.      processid = getpid();
  1497. ! #if defined(hpux) || defined(linux)
  1498.      setpgrp();
  1499.   #else /* hpux */
  1500.      setpgrp(0,processid);
  1501. diff -cr --new-file andrew.orig/atk/preview/previewa.c andrew/atk/preview/previewa.c
  1502. *** andrew.orig/atk/preview/previewa.c    Fri Jan 24 04:04:43 1992
  1503. --- andrew/atk/preview/previewa.c    Sun Sep  5 10:55:06 1993
  1504. ***************
  1505. *** 24,29 ****
  1506. --- 24,33 ----
  1507.   #include <im.ih>
  1508.   #include <signal.h>
  1509.   
  1510. + #ifdef linux
  1511. + #include <bsd/signal.h>
  1512. + #endif
  1513.   char *DviBaseName=NULL;
  1514.   char *DviFileName=NULL;
  1515.   boolean DoScaling = TRUE;
  1516. diff -cr --new-file andrew.orig/atk/support/complete.c andrew/atk/support/complete.c
  1517. *** andrew.orig/atk/support/complete.c    Fri Jan 24 04:06:35 1992
  1518. --- andrew/atk/support/complete.c    Sat Sep  4 11:04:49 1993
  1519. ***************
  1520. *** 26,32 ****
  1521.   
  1522.   #include <sys/param.h>
  1523.   #include <sys/stat.h>
  1524. ! #ifdef M_UNIX
  1525.   #include <dirent.h>
  1526.   #define direct dirent
  1527.   #else
  1528. --- 26,32 ----
  1529.   
  1530.   #include <sys/param.h>
  1531.   #include <sys/stat.h>
  1532. ! #if defined(M_UNIX) || defined(linux)
  1533.   #include <dirent.h>
  1534.   #define direct dirent
  1535.   #else
  1536. diff -cr --new-file andrew.orig/atk/support/print.c andrew/atk/support/print.c
  1537. *** andrew.orig/atk/support/print.c    Fri Jan 24 04:06:48 1992
  1538. --- andrew/atk/support/print.c    Sat Sep  4 12:06:45 1993
  1539. ***************
  1540. *** 377,383 ****
  1541.   #ifdef hpux
  1542.           setpgrp2(0, pg = getpid());
  1543.   #else /* hpux */
  1544. ! #ifdef SGI_4D_ENV
  1545.           setpgrp();
  1546.   #else
  1547.           setpgrp(0, pg = getpid());
  1548. --- 377,383 ----
  1549.   #ifdef hpux
  1550.           setpgrp2(0, pg = getpid());
  1551.   #else /* hpux */
  1552. ! #if defined(SGI_4D_ENV) || defined(linux)
  1553.           setpgrp();
  1554.   #else
  1555.           setpgrp(0, pg = getpid());
  1556. diff -cr --new-file andrew.orig/atk/supportviews/Imakefile andrew/atk/supportviews/Imakefile
  1557. *** andrew.orig/atk/supportviews/Imakefile    Fri Jan 24 04:07:15 1992
  1558. --- andrew/atk/supportviews/Imakefile    Tue Sep  7 10:01:46 1993
  1559. ***************
  1560. *** 13,19 ****
  1561.       palette.do \
  1562.                 sbutton.do \
  1563.                 sbuttonv.do \
  1564. !               sbttnav.do \ 
  1565.       scroll.do \
  1566.       strtbl.do \
  1567.       strtblv.do
  1568. --- 13,19 ----
  1569.       palette.do \
  1570.                 sbutton.do \
  1571.                 sbuttonv.do \
  1572. !               sbttnav.do \
  1573.       scroll.do \
  1574.       strtbl.do \
  1575.       strtblv.do
  1576. ***************
  1577. *** 28,34 ****
  1578.       oscroll.ih \
  1579.       palette.ih \
  1580.       sbutton.ih \
  1581. !     sbuttonv.ih \ 
  1582.       sbttnav.ih \
  1583.       scroll.ih \
  1584.       strtbl.ih \
  1585. --- 28,34 ----
  1586.       oscroll.ih \
  1587.       palette.ih \
  1588.       sbutton.ih \
  1589. !     sbuttonv.ih \
  1590.       sbttnav.ih \
  1591.       scroll.ih \
  1592.       strtbl.ih \
  1593. ***************
  1594. *** 43,50 ****
  1595.       matte.o \
  1596.       oscroll.o \
  1597.       sbutton.o \
  1598. !     sbuttonv.o \ 
  1599. !     sbttnav.o \ 
  1600.       palette.o \
  1601.       scroll.o \
  1602.       strtbl.o \
  1603. --- 43,50 ----
  1604.       matte.o \
  1605.       oscroll.o \
  1606.       sbutton.o \
  1607. !     sbuttonv.o \
  1608. !     sbttnav.o \
  1609.       palette.o \
  1610.       scroll.o \
  1611.       strtbl.o \
  1612. diff -cr --new-file andrew.orig/atk/text/txtvcmds.c andrew/atk/text/txtvcmds.c
  1613. *** andrew.orig/atk/text/txtvcmds.c    Sun Mar  1 07:43:10 1992
  1614. --- andrew/atk/text/txtvcmds.c    Thu Sep  9 13:18:32 1993
  1615. ***************
  1616. *** 499,505 ****
  1617.   {
  1618.       struct keymap *newKeymap = keymap_New();
  1619.       register long i;
  1620. !     char str[2];
  1621.       struct proctable_Entry *si;
  1622.       
  1623.       if(normalMenus!=NULL)
  1624. --- 499,505 ----
  1625.   {
  1626.       struct keymap *newKeymap = keymap_New();
  1627.       register long i;
  1628. !     unsigned char str[2];
  1629.       struct proctable_Entry *si;
  1630.       
  1631.       if(normalMenus!=NULL)
  1632. diff -cr --new-file andrew.orig/atk/text/txtvcmod.c andrew/atk/text/txtvcmod.c
  1633. *** andrew.orig/atk/text/txtvcmod.c    Fri Jan 24 04:09:52 1992
  1634. --- andrew/atk/text/txtvcmod.c    Thu Sep  9 13:18:32 1993
  1635. ***************
  1636. *** 123,129 ****
  1637.   
  1638.   void textview_SelfInsertCmd(self, a)
  1639.   register struct textview *self;
  1640. ! char a;
  1641.   {
  1642.       register int ct, i, pos;
  1643.       register struct text *d;
  1644. --- 123,129 ----
  1645.   
  1646.   void textview_SelfInsertCmd(self, a)
  1647.   register struct textview *self;
  1648. ! unsigned char a;
  1649.   {
  1650.       register int ct, i, pos;
  1651.       register struct text *d;
  1652. ***************
  1653. *** 1449,1455 ****
  1654.   
  1655.   void textview_DigitCmd(self, c)
  1656.   struct textview *self;
  1657. ! register char c;
  1658.   {
  1659.       struct im *im = textview_GetIM(self);
  1660.   
  1661. --- 1449,1455 ----
  1662.   
  1663.   void textview_DigitCmd(self, c)
  1664.   struct textview *self;
  1665. ! register unsigned char c;
  1666.   {
  1667.       struct im *im = textview_GetIM(self);
  1668.   
  1669. diff -cr --new-file andrew.orig/atk/textobjects/dired.c andrew/atk/textobjects/dired.c
  1670. *** andrew.orig/atk/textobjects/dired.c    Fri Jan 24 04:10:56 1992
  1671. --- andrew/atk/textobjects/dired.c    Sat Sep  4 11:06:13 1993
  1672. ***************
  1673. *** 6,12 ****
  1674.   
  1675.   #include <class.h>
  1676.   #include <andrewos.h>
  1677. ! #ifdef M_UNIX
  1678.   #include <dirent.h>
  1679.   #define direct dirent
  1680.   #else
  1681. --- 6,12 ----
  1682.   
  1683.   #include <class.h>
  1684.   #include <andrewos.h>
  1685. ! #if defined(M_UNIX) || defined(linux)
  1686.   #include <dirent.h>
  1687.   #define direct dirent
  1688.   #else
  1689. diff -cr --new-file andrew.orig/atk/typescript/tscript.c andrew/atk/typescript/tscript.c
  1690. *** andrew.orig/atk/typescript/tscript.c    Fri Jan 24 04:10:45 1992
  1691. --- andrew/atk/typescript/tscript.c    Sat Sep  4 12:06:46 1993
  1692. ***************
  1693. *** 48,53 ****
  1694. --- 48,59 ----
  1695.   #include <sys/ptem.h>
  1696.   #endif
  1697.   
  1698. + #if defined(linux) || defined(HAVE_STREAMBUF)
  1699. + #define FILE_USED(f) ((f)->_egptr - (f)->_gptr)
  1700. + #else
  1701. + #define FILE_USED(f) ((f)->_cnt)
  1702. + #endif
  1703. +  
  1704.   #include <signal.h>
  1705.   
  1706.   #if defined(POSIX_ENV) && !defined(sun)
  1707. ***************
  1708. *** 992,998 ****
  1709.       register char *cp;
  1710.       register c;
  1711.       register int i = *bufsiz;
  1712. !     for(cp = buf; --i && f->_cnt > 0; cp++) {
  1713.       if((c = getc(f)) == EOF) {
  1714.           im_RemoveFileHandler(f);
  1715.           self->SubChannel = -1;
  1716. --- 998,1004 ----
  1717.       register char *cp;
  1718.       register c;
  1719.       register int i = *bufsiz;
  1720. !     for(cp = buf; --i && FILE_USED(f) > 0; cp++) {
  1721.       if((c = getc(f)) == EOF) {
  1722.           im_RemoveFileHandler(f);
  1723.           self->SubChannel = -1;
  1724. ***************
  1725. *** 1044,1050 ****
  1726.       }
  1727.       else if(c != '\015') 
  1728.           *bp++ = c;
  1729. !         while(--i && f->_cnt > 0) {
  1730.           if((c = getc(f)) == EOF) 
  1731.           break;
  1732.           if(odf) 
  1733. --- 1050,1056 ----
  1734.       }
  1735.       else if(c != '\015') 
  1736.           *bp++ = c;
  1737. !         while(--i && FILE_USED(f) > 0) {
  1738.           if((c = getc(f)) == EOF) 
  1739.           break;
  1740.           if(odf) 
  1741. ***************
  1742. *** 1166,1172 ****
  1743.   {
  1744.       int pid;
  1745.       char **arglist = NULL;
  1746. ! #ifdef SGI_4D_ENV
  1747.       int pgrp = getpgrp();
  1748.   #else
  1749.       int pgrp = getpgrp(0);
  1750. --- 1172,1178 ----
  1751.   {
  1752.       int pid;
  1753.       char **arglist = NULL;
  1754. ! #if defined(SGI_4D_ENV) || defined(linux)
  1755.       int pgrp = getpgrp();
  1756.   #else
  1757.       int pgrp = getpgrp(0);
  1758. diff -cr --new-file andrew.orig/atk/zip/lib/zip.h andrew/atk/zip/lib/zip.h
  1759. *** andrew.orig/atk/zip/lib/zip.h    Fri Jan 24 04:13:12 1992
  1760. --- andrew/atk/zip/lib/zip.h    Wed Sep  8 23:31:29 1993
  1761. ***************
  1762. *** 108,113 ****
  1763. --- 108,114 ----
  1764.   #ifndef DEBUG
  1765.   char    debug;
  1766.   #ifdef DB
  1767. + #ifndef __STDC__
  1768.   #define  IN( x )        if ( debug ) printf( ">x\n" );
  1769.   #define  OUT( x )        if ( debug ) printf( "<x\n" );
  1770.   #define  DEBUG( y )        if ( debug ) printf( " %s\n", "y" );
  1771. ***************
  1772. *** 121,126 ****
  1773. --- 122,142 ----
  1774.   #define  DEBUGgt( t, y )    if ( debug ) printf( " t: %g\n", y );
  1775.   #define  DEBUGx( y )        if ( debug ) printf( " %x\n", y );
  1776.   #define  DEBUGxt( t, y )    if ( debug ) printf( " t: %x\n", y );
  1777. + #else
  1778. + #define  IN( x )        if ( debug ) printf( ">" #x "\n" );
  1779. + #define  OUT( x )        if ( debug ) printf( "<" #x "\n" );
  1780. + #define  DEBUG( y )        if ( debug ) printf( " %s\n", #y );
  1781. + #define  DEBUGc( y )        if ( debug ) printf( " '%c'\n", #y );
  1782. + #define  DEBUGct( t, y )    if ( debug ) printf( " t: '%c'\n", y );
  1783. + #define  DEBUGs( y )        if ( debug ) printf( " '%s'\n", #y );
  1784. + #define  DEBUGst( t, y )    if ( debug ) printf( " t: '%s'\n", y );
  1785. + #define  DEBUGd( y )        if ( debug ) printf( " %d\n", y );
  1786. + #define  DEBUGdt( t, y )    if ( debug ) printf( " t: %d\n", y );
  1787. + #define  DEBUGlt( t, y )    if ( debug ) printf( " t: %D\n", y );
  1788. + #define  DEBUGgt( t, y )    if ( debug ) printf( " t: %g\n", y );
  1789. + #define  DEBUGx( y )        if ( debug ) printf( " %x\n", y );
  1790. + #define  DEBUGxt( t, y )    if ( debug ) printf( " t: %x\n", y );
  1791. + #endif /* __STDC__ */
  1792.   #else /* DB */
  1793.   #define  IN( x )
  1794.   #define  OUT( x )
  1795. diff -cr --new-file andrew.orig/atkams/messages/lib/stubs.c andrew/atkams/messages/lib/stubs.c
  1796. *** andrew.orig/atkams/messages/lib/stubs.c    Fri Jan 24 04:16:06 1992
  1797. --- andrew/atkams/messages/lib/stubs.c    Sat Sep  4 12:06:48 1993
  1798. ***************
  1799. *** 189,194 ****
  1800. --- 189,197 ----
  1801.           sprintf(Msg, "Dumping core in directory %s", CoreDirectory);
  1802.           errprintf(im_GetProgramName(), ERR_CRITICAL, 0, 0, Msg);
  1803.           ReportSuccess(Msg);
  1804. + #ifndef SIGBUS
  1805. + #define SIGBUS SIGSEGV
  1806. + #endif
  1807.           kill(getpid(), SIGBUS);
  1808.           return(-1); /* Hah!  That's what you think, you stupid compiler. */
  1809.       }
  1810. diff -cr --new-file andrew.orig/atkams/messages/lib/text822.c andrew/atkams/messages/lib/text822.c
  1811. *** andrew.orig/atkams/messages/lib/text822.c    Fri Apr 10 05:01:39 1992
  1812. --- andrew/atkams/messages/lib/text822.c    Sat Sep  4 12:06:48 1993
  1813. ***************
  1814. *** 637,643 ****
  1815.       } else {
  1816.           strcpy(Label, "Object of type '");
  1817.           strncat(Label, ContentTypeOverride, sizeof(Label) - 25);
  1818. !         strncat(Label, "'");
  1819.       }
  1820.       mailobj_SetLabel(mo, 0, Label);
  1821.       }
  1822. --- 637,643 ----
  1823.       } else {
  1824.           strcpy(Label, "Object of type '");
  1825.           strncat(Label, ContentTypeOverride, sizeof(Label) - 25);
  1826. !         strcat(Label, "'");
  1827.       }
  1828.       mailobj_SetLabel(mo, 0, Label);
  1829.       }
  1830. diff -cr --new-file andrew.orig/config/i386_linux/system.h andrew/config/i386_linux/system.h
  1831. *** andrew.orig/config/i386_linux/system.h
  1832. --- andrew/config/i386_linux/system.h    Mon Sep  6 21:13:07 1993
  1833. ***************
  1834. *** 0 ****
  1835. --- 1,93 ----
  1836. + /* ********************************************************************** *\
  1837. +  *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
  1838. +  *        For full copyright information see:'andrew/config/COPYRITE'     *
  1839. + \* ********************************************************************** */
  1840. + #ifndef    SYSTEM_H
  1841. + #define    SYSTEM_H
  1842. + /* Get common definitions */
  1843. + #include <allsys.h>
  1844. + #define    OPSYSNAME    "i386_linux"
  1845. + #define    SYS_NAME    "i386_linux"
  1846. + #define vax2            1
  1847. + #define    sys_vax_43    1
  1848. + #define    VAX_ENV         1
  1849. + #undef  ANDREW_MALLOC_ENV    /* conflicts with linux shared libs */
  1850. +                 /* somehow. Don't have time to fix, */
  1851. +                 /* and linux mallocer has all the */
  1852. +                 /* features of andrew anyway. */
  1853. + #define POSIX_ENV 1        /* roll on POSIX.. */
  1854. + /* #define M_UNIX */ /* Would like to define this for the directory */
  1855. + /* handleing, but unfortunately, it is used for time handleing as */
  1856. + /* well. */
  1857. + #define FNDELAY O_NDELAY    /* cos linux is a posix env, and */
  1858. +                 /* doesn't have REALLY old junk.. :) */
  1859. + #define NDEBUG            /* some places use asserts()'s, but */
  1860. +                 /* linux doesn't have ___eprintf() in */
  1861. +                 /* the shared libs for some reason. So */
  1862. +                 /* we just turn them off. */
  1863. + /* Here follow the overrides for this system. */
  1864. + #undef    SY_B43
  1865. + #define    SY_B43    1 /* This system is most like bsd 4.3 */
  1866. + #ifndef In_Imake
  1867. + /* Get major data types (esp. caddr_t) */
  1868. + #include <sys/types.h>
  1869. + #include <unistd.h>
  1870. + /* Get open(2) constants */
  1871. + #include <sys/file.h>
  1872. + #include <strings.h>
  1873. + /* Get struct timeval */
  1874. + #include <sys/time.h>
  1875. + /* include path for syslog.h */
  1876. + #include <syslog.h>
  1877. + /* VMUNIX vs. SY_B4x */
  1878. + #ifndef VMUNIX
  1879. + #define    VMUNIX    1
  1880. + #endif VMUNIX
  1881. + #define OSI_HAS_SYMLINKS 1
  1882. + #define osi_readlink(PATH,BUF,SIZE) readlink((PATH),(BUF),(SIZE))
  1883. + #define osi_ExclusiveLockNoBlock(fid)    flock((fid), LOCK_EX | LOCK_NB)
  1884. + #define osi_UnLock(fid)            flock((fid), LOCK_UN)
  1885. + #define osi_O_READLOCK            O_RDONLY
  1886. + #define osi_F_READLOCK            "r"
  1887. + #define    osi_vfork()            fork()
  1888. + #define    osi_setjmp  _setjmp
  1889. + #define    osi_longjmp _longjmp
  1890. + /* Make a time standard. */
  1891. + struct osi_Times {unsigned long int Secs; unsigned long int USecs;};
  1892. + /* Set one of the above with a call to osi_GetTimes(&foo) */
  1893. + #define osi_GetSecs() time((long int *) 0)
  1894. + extern void osi_SetZone();
  1895. + extern char *osi_ZoneNames[];
  1896. + extern long int osi_SecondsWest;
  1897. + extern int osi_IsEverDaylight;
  1898. + /* Put system-specific definitions here */
  1899. + #define HAS_SYSEXITS 1
  1900. + #endif /* !In_Imake */
  1901. + /* Now follow the site-specific customizations. */
  1902. + #include <site.h>
  1903. + #endif    /* SYSTEM_H */
  1904. diff -cr --new-file andrew.orig/config/i386_linux/system.mcr andrew/config/i386_linux/system.mcr
  1905. *** andrew.orig/config/i386_linux/system.mcr
  1906. --- andrew/config/i386_linux/system.mcr    Thu Sep  9 08:14:29 1993
  1907. ***************
  1908. *** 0 ****
  1909. --- 1,27 ----
  1910. + /* Copyright IBM Corporation 1988,1991 - All Rights Reserved */
  1911. + /* For full copyright information see:'andrew/config/COPYRITE' */
  1912. + #define In_Imake 1
  1913. + /* The next two lines need to be kept in sync */
  1914. + #include <i386_linux/system.h>
  1915. +         SYSTEM_H_FILE = i386_linux/system.h
  1916. + #undef In_Imake
  1917. + /* These next two lines help configure the embedded machine-dependent
  1918. +     directories overhead/class/machdep, atk/console/stats, and
  1919. +     atk/console/stats/common. */
  1920. +         SYS_IDENT = i386_linux
  1921. +         SYS_OS_ARCH = i386_linux
  1922. + /* Get parent inclusions */
  1923. + #include <allsys.mcr>
  1924. + /* Now for the system-dependent information. */
  1925. +         CDEBUGFLAGS = -O -fwritable-strings  -D_BSD_SOURCE
  1926. +     CSHELL = tcsh
  1927. + /* Get site-specific inclusions */
  1928. + #include <site.mcr>
  1929. + #define SITE_ENV
  1930. diff -cr --new-file andrew.orig/config/platform.tmpl andrew/config/platform.tmpl
  1931. *** andrew.orig/config/platform.tmpl    Tue Apr  7 01:23:02 1992
  1932. --- andrew/config/platform.tmpl    Sat Sep  4 10:54:55 1993
  1933. ***************
  1934. *** 150,155 ****
  1935. --- 150,160 ----
  1936.   #define MacroIncludeFile next_mach20/system.mcr
  1937.   #endif /* next_mach20 */
  1938.   
  1939. + #ifdef linux
  1940. + #include <i386_linux/system.mcr>
  1941. + #define MacroIncludeFile i386_linux/system.mcr
  1942. + #endif
  1943.   /**/#
  1944.   /**/# Back from the macro file
  1945.   /**/#
  1946. diff -cr --new-file andrew.orig/config/site.h andrew/config/site.h
  1947. *** andrew.orig/config/site.h    Wed Apr  8 06:47:59 1992
  1948. --- andrew/config/site.h    Mon Sep  6 21:29:06 1993
  1949. ***************
  1950. *** 1,3 ****
  1951. --- 1,9 ----
  1952.   /* CMU-local overrides to the distributed system.mcr file.  The distributed version */
  1953.   /*   of this file is empty, and patches are never sent for it. */
  1954.   
  1955. + #define CONTRIB_ENV
  1956. + #define MK_BASIC_UTILS
  1957. + #define MK_AUTHORING
  1958. + #define MK_AUX_UTILS
  1959. + #define MK_AUX_INSETS
  1960. diff -cr --new-file andrew.orig/config/site.mcr andrew/config/site.mcr
  1961. *** andrew.orig/config/site.mcr    Wed Apr  8 06:48:15 1992
  1962. --- andrew/config/site.mcr    Tue Sep  7 09:57:18 1993
  1963. ***************
  1964. *** 1,2 ****
  1965. --- 1,4 ----
  1966.   /* CMU-local overrides to the distributed system.mcr file.  The distributed version */
  1967.   /*   of this file is empty, and patches are never sent for it. */
  1968. + LINKFLAGS=-O
  1969. diff -cr --new-file andrew.orig/config/site.rls andrew/config/site.rls
  1970. *** andrew.orig/config/site.rls    Fri Jan 24 03:37:59 1992
  1971. --- andrew/config/site.rls    Tue Sep  7 09:56:24 1993
  1972. ***************
  1973. *** 5,7 ****
  1974. --- 5,32 ----
  1975.   
  1976.    /* Empty site.rls file.  Use this file to hold all */
  1977.    /* your site's additions to andrew.rls. */
  1978. + #undef NormalAsmPPRule
  1979. + #define    NormalAsmPPRule()                    @@\
  1980. + .spp.o:                                @@\
  1981. +     $(RM) $@ ,$*.s ,$*.c                    @@\
  1982. +     $(CP) $*.spp ,$*.c                    @@\
  1983. +     $(ASMPP_CC) $(CFLAGS)  ,$*.c | $(TR) ';' '\n' > ,$*.s    @@\
  1984. +     $(AS) $(AS_FLAGS) -o $*.o ,$*.s                @@\
  1985. +     $(RM) ,$*.c ,$*.s
  1986. + #undef TestProgramTarget
  1987. + #define    TestProgramTarget(program, objs, libs, syslibs)        @@\
  1988. + test:: program                            @@\
  1989. + program: objs libs                        @@\
  1990. +     $(RM) $@                        @@\
  1991. +     $(CC) $(LINKFLAGS) -o $@ objs libs syslibs        @@\
  1992. + clean:: ; $(RM) program
  1993. + #undef ProgramTarget
  1994. + #define    ProgramTarget(program, objs, libs, syslibs)        @@\
  1995. + all:: program                            @@\
  1996. + program: objs libs                        @@\
  1997. +     $(RM) $@                        @@\
  1998. +     $(CC) $(LINKFLAGS) -o $@ objs libs syslibs        @@\
  1999. + clean:: ; $(RM) program
  2000. diff -cr --new-file andrew.orig/contrib/mit/2rtf/main.c andrew/contrib/mit/2rtf/main.c
  2001. *** andrew.orig/contrib/mit/2rtf/main.c    Sat Feb 15 01:55:08 1992
  2002. --- andrew/contrib/mit/2rtf/main.c    Sun Sep  5 11:21:18 1993
  2003. ***************
  2004. *** 24,31 ****
  2005.   
  2006.    $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/2rtf/RCS/main.c,v 1.2 1992/02/14 17:53:38 gk5g Exp $
  2007.   */
  2008.   #include <stdio.h>
  2009.   #include <sys/file.h>  /* access() */
  2010.   #include <sys/errno.h>
  2011. --- 24,32 ----
  2012.   
  2013.    $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/2rtf/RCS/main.c,v 1.2 1992/02/14 17:53:38 gk5g Exp $
  2014.   */
  2015. ! #ifdef linux
  2016. ! #include <unistd.h>        /* get R_OK etc.. */
  2017. ! #endif
  2018.   #include <stdio.h>
  2019.   #include <sys/file.h>  /* access() */
  2020.   #include <sys/errno.h>
  2021. diff -cr --new-file andrew.orig/contrib/mit/annot/iconview.c andrew/contrib/mit/annot/iconview.c
  2022. *** andrew.orig/contrib/mit/annot/iconview.c    Fri Jan 24 04:19:23 1992
  2023. --- andrew/contrib/mit/annot/iconview.c    Sun Sep  5 11:18:36 1993
  2024. ***************
  2025. *** 26,32 ****
  2026.   #include "keymap.ih"
  2027.   #include "buffer.ih"
  2028.   #include <im.ih>
  2029.   static struct iconview *First;
  2030.   
  2031.   /* Global determines if new icon views will draw open or closed. */
  2032. --- 26,34 ----
  2033.   #include "keymap.ih"
  2034.   #include "buffer.ih"
  2035.   #include <im.ih>
  2036. ! #ifdef linux
  2037. ! #include <bsd/bsd.h>        /* suck in MIN defn. */
  2038. ! #endif
  2039.   static struct iconview *First;
  2040.   
  2041.   /* Global determines if new icon views will draw open or closed. */
  2042. diff -cr --new-file andrew.orig/contrib/mit/rtf2/main.c andrew/contrib/mit/rtf2/main.c
  2043. *** andrew.orig/contrib/mit/rtf2/main.c    Thu Mar  5 01:27:46 1992
  2044. --- andrew/contrib/mit/rtf2/main.c    Sun Sep  5 11:21:52 1993
  2045. ***************
  2046. *** 26,32 ****
  2047.    $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/rtf2/RCS/main.c,v 1.2 1992/03/04 17:26:42 gk5g Exp $
  2048.   */
  2049.   
  2050.   #include <stdio.h>
  2051.   #include <sys/file.h>  /* access() */
  2052.   #include <sys/errno.h>
  2053. --- 26,34 ----
  2054.    $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/mit/rtf2/RCS/main.c,v 1.2 1992/03/04 17:26:42 gk5g Exp $
  2055.   */
  2056.   
  2057. ! #ifdef linux
  2058. ! #include <unistd.h>        /* get R_OK et al */
  2059. ! #endif
  2060.   #include <stdio.h>
  2061.   #include <sys/file.h>  /* access() */
  2062.   #include <sys/errno.h>
  2063. diff -cr --new-file andrew.orig/overhead/class/lib/class.c andrew/overhead/class/lib/class.c
  2064. *** andrew.orig/overhead/class/lib/class.c    Fri Jan 24 04:23:00 1992
  2065. --- andrew/overhead/class/lib/class.c    Sat Sep  4 12:06:49 1993
  2066. ***************
  2067. *** 30,36 ****
  2068.   #include <class.h>  /* this contains all the structs, etc. for the class system */
  2069.   #include <doload.h>
  2070.   #include <errno.h>
  2071.   /* external symbols that have no include files */
  2072.   
  2073.   
  2074. --- 30,38 ----
  2075.   #include <class.h>  /* this contains all the structs, etc. for the class system */
  2076.   #include <doload.h>
  2077.   #include <errno.h>
  2078. ! #ifdef linux
  2079. ! #include <bsd/signal.h>
  2080. ! #endif
  2081.   /* external symbols that have no include files */
  2082.   
  2083.   
  2084. diff -cr --new-file andrew.orig/overhead/class/machdep/i386_linux/Imakefile andrew/overhead/class/machdep/i386_linux/Imakefile
  2085. *** andrew.orig/overhead/class/machdep/i386_linux/Imakefile
  2086. --- andrew/overhead/class/machdep/i386_linux/Imakefile    Mon Sep  6 20:23:16 1993
  2087. ***************
  2088. *** 0 ****
  2089. --- 1,75 ----
  2090. + /* ********************************************************************** *\
  2091. +  *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
  2092. +  *        For full copyright information see:'andrew/config/COPYRITE'     *
  2093. + \* ********************************************************************** */
  2094. + #define GNU_ENV
  2095. + #if 0
  2096. + LIBC=/usr/lib/libg.a
  2097. + GNULIB=/usr/lib/libgcc.a
  2098. + #else
  2099. + LIBC=/usr/lib/libc.sa
  2100. + GNULIB=/usr/lib/libgcc.sa
  2101. + #endif
  2102. + DependTarget(globalrefs._h)
  2103. + NormalObjectRule()
  2104. + NormalAsmPPRule()
  2105. + #ifdef RESOLVER_ENV
  2106. + RESOLVER_LIB = $(RESOLVLIB)
  2107. + LIBC_RESOLVER_LIST = gethostnamadr.o gethostent.o res_comp.o res_debug.o res_init.o res_mkquery.o res_send.o sethostent.o res_search.o
  2108. + RESOLVER_SPLIT_CMD = /bin/sh -c 'if test $(RESOLVER_LIB); \
  2109. +     then ar x $(RESOLVER_LIB); fi; exit 0';
  2110. + LIBC_RESOLVER_HACK = /bin/sh -c 'if test $(RESOLVER_LIB); \
  2111. +     then ar d libcx.a $(LIBC_RESOLVER_LIST); fi; exit 0';
  2112. + #endif
  2113. + all::         globals.o entry.o doload.o
  2114. + globals.o:      globals.spp globalrefs._h
  2115. + globalrefs._h:    libc.eplist
  2116. +         $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h
  2117. +         $(MV) ,globalrefs._h globalrefs._h
  2118. + libc.eplist:    $(LIBC) /usr/lib/crt0.o $(RESOLVER_LIB) ${GNULIB} getlist.awk
  2119. +         $(RM) /tmp/libhack.a
  2120. +         $(AR) /tmp/libhack.a /usr/lib/crt0.o
  2121. +         $(NM) -go --no-cplus $(RESOLVER_LIB) $(LIBC) ${GNULIB} /tmp/libhack.a | $(TR) ":()" "   " | \
  2122. +             $(AWK) -f getlist.awk >,libc.eplist
  2123. +         $(MV) ,libc.eplist libc.eplist
  2124. +         $(RM) /tmp/libhack.a
  2125. + InstallLibrary(libcx.a, $(DESTDIR)/lib)
  2126. + InstallCshScript(makedo.csh, $(DESTDIR)/bin/makedo)
  2127. + #ifdef GNU_ENV
  2128. +   ARCHIVE_COM = ar x ${GNULIB} ;
  2129. + #endif /* GNU_ENV */
  2130. + all::        libcx.a
  2131. + DelList._:    libc.eplist
  2132. +         touch DelList._
  2133. + #        $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._
  2134. + #        $(MV) ,DelList._ DelList._
  2135. + libcx.a:        $(LIBC) /usr/lib/crt0.o $(RESOLVER_LIB) ${GNULIB} DelList._
  2136. +                 rm -rf new
  2137. +                 mkdir new
  2138. +                         cd new ; \
  2139. +               $(RESOLVER_SPLIT_CMD) \
  2140. +             $(CP)  /usr/lib/crt0.o crt0.o ; \
  2141. +                         $(CP) $(LIBC) ,libcx.a ; $(ARCHIVE_COM) \
  2142. +                         $(CHMODW) ,libcx.a ; \
  2143. +                         ar q ,libcx.a *.o
  2144. +                 mv new/,libcx.a libcx.a
  2145. +                 -ar d libcx.a `cat DelList._`
  2146. +         $(LIBC_RESOLVER_HACK)
  2147. +                 $(RANLIB) libcx.a
  2148. +                 rm -rf new
  2149. + all::         dofix.o
  2150. + clean::
  2151. +         $(RM) DelList._ libc.eplist globalrefs._h ,* libcx.a
  2152. diff -cr --new-file andrew.orig/overhead/class/machdep/i386_linux/aixfix.h andrew/overhead/class/machdep/i386_linux/aixfix.h
  2153. *** andrew.orig/overhead/class/machdep/i386_linux/aixfix.h
  2154. --- andrew/overhead/class/machdep/i386_linux/aixfix.h    Mon Sep  6 19:30:46 1993
  2155. ***************
  2156. *** 0 ****
  2157. --- 1,39 ----
  2158. + /* ********************************************************************** *\
  2159. +  *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
  2160. +  *        For full copyright information see:'andrew/config/COPYRITE'     *
  2161. + \* ********************************************************************** */
  2162. + /* MACROS TO HELP PORTABILITITY */
  2163. + #ifndef AIX
  2164. + #define RP_LENGTH( rp ) ( rp->r_length )
  2165. + #define IS_RP_EXTERN( rp ) ( rp->r_extern )
  2166. + #define IS_RP_PC_REL( rp ) ( rp->r_pcrel )
  2167. + #define SYM_TYPE( sp ) ( sp->n_type & N_TYPE )
  2168. + #define IS_EXTERN_SYM( sp ) ( sp->n_type & N_EXT )
  2169. + #else
  2170. + #define nlist syment
  2171. + #define r_address r_vaddr
  2172. + #define r_symbolnum r_symndx
  2173. + #define relocation_info reloc
  2174. + #define N_EXT C_EXT
  2175. + #define N_TYPE N_SECT
  2176. + #define RP_LENGTH( rp ) ( \
  2177. +   ( ( rp->r_type == 2 ) || ( rp->r_type == 3 ) ) ? 0 \
  2178. + : ( ( ( rp->r_type == 4 ) || ( rp->r_type == 5 ) ) ? 1 \
  2179. +   : ( ( ( rp->r_type == 6 ) || ( rp->r_type == 7 ) \
  2180. +      || ( rp->r_type == 9 ) || ( rp->r_type == 12 ) ) ? 2 \
  2181. +     : ( ( rp->r_type == 8 ) ? 3 \
  2182. +       : /* rp->r_type == R_ABS or R_SEG86 or R_SEG286 */ -1 ) ) ) )
  2183. + #define IS_RP_EXTERN( rp ) ( ( rp->r_symndx & S_BSS ) != S_BSS )
  2184. + #define IS_RP_PC_REL( rp ) ( \
  2185. +     ( rp->r_type == 3 ) || ( rp->r_type == 5 ) \
  2186. +  || ( rp->r_type == 7 ) || ( rp->r_type == 9 ) \
  2187. +  || ( rp->r_type == 12 ) )
  2188. + #define SYM_TYPE( sp ) ( sp->n_sclass & N_SECT )
  2189. + #define IS_EXTERN_SYM( sp ) ( ( sp->n_sclass & N_CLASS ) == C_EXT )
  2190. + #define N_BADMAG( x ) BADMAG( x )
  2191. + #define N_TXTOFF( x ) A_TEXTPOS( x )
  2192. + #endif
  2193. diff -cr --new-file andrew.orig/overhead/class/machdep/i386_linux/dofix.c andrew/overhead/class/machdep/i386_linux/dofix.c
  2194. *** andrew.orig/overhead/class/machdep/i386_linux/dofix.c
  2195. --- andrew/overhead/class/machdep/i386_linux/dofix.c    Mon Sep  6 19:30:46 1993
  2196. ***************
  2197. *** 0 ****
  2198. --- 1,310 ----
  2199. + /* ********************************************************************** *\
  2200. +  *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
  2201. +  *        For full copyright information see:'andrew/config/COPYRITE'     *
  2202. + \* ********************************************************************** */
  2203. + static char *dofix_rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/class/machdep/i386_mach/RCS/dofix.c,v 1.2 1991/09/12 17:05:23 bobg Exp $";
  2204. + /* 
  2205. +     dofix.c - convert .o file into .do file
  2206. +     Author:  John H Howard - April 9, 1987
  2207. +  */
  2208. + #include <stdio.h>
  2209. + #include <andrewos.h> /* sys/file.h */
  2210. + #include <a.out.h>
  2211. + #include <setjmp.h>
  2212. + #include <doload.h>
  2213. + #include <aixfix.h>
  2214. + #include <../common/safe.h>
  2215. + /* set entry point */
  2216. + /*
  2217. +  * NOTE - The RT uses entry points in the data segment, rather
  2218. +  * than the text segment as is usually the case.  In order to
  2219. +  * allow this, we represent data segment entry points by adding
  2220. +  * the text segment size to the offset within the data segment.
  2221. +  */
  2222. + FixEntryPoint(e, EntryPointName)
  2223. + register struct doload_environment *e;
  2224. + char *EntryPointName;
  2225. + {
  2226. +     register struct nlist *sp;
  2227. +     register struct nlist *sbound;
  2228. +     if (EntryPointName == NULL || *EntryPointName == NULL)
  2229. +     return;
  2230. +     sp = e->symtab;
  2231. +     sbound = (struct nlist *)((char *)sp + e->header.a_syms);
  2232. +     for (; sp < sbound; sp++) {
  2233. +     if ( SYM_TYPE( sp ) != N_UNDF
  2234. +      && (IS_EXTERN_SYM( sp ) && !(sp->n_type & N_STAB))
  2235. +      && strcmp( EntryPointName,
  2236. +             ((sp->n_un.n_strx)
  2237. +             ? (e->stringtab + sp->n_un.n_strx)
  2238. +             : "<<noname>>") ) == 0 )
  2239. +         {
  2240. +         switch ( SYM_TYPE(sp) ) {
  2241. +         case N_DATA:
  2242. +         case N_TEXT:
  2243. +         e->header.a_entry = sp->n_value;
  2244. +         break;
  2245. +         default:
  2246. +         fprintf( stderr,
  2247. +          "dofix:  invalid entry point relocation %x\n", SYM_TYPE(sp) ) ;
  2248. +         e->problems++;
  2249. +         } /* end of switch */
  2250. +         return;
  2251. +     } /* end of name match */
  2252. +     } /* end of loop */
  2253. +     fprintf(stderr, "dofix:  entry point %s undefined\n", EntryPointName);
  2254. +     e->problems++;
  2255. +     return;
  2256. + }
  2257. + /* fix up one relocation table entry */
  2258. + extern struct globaltab {
  2259. +     long entrypoint;    /* entry point value */
  2260. +     char *entryname;    /* symbolic name */
  2261. + } globals[];
  2262. + extern long globalcount;
  2263. + FixRelocation(e, rp)
  2264. + register struct doload_environment *e;
  2265. + register struct relocation_info *rp;
  2266. + {
  2267. +     register int i;
  2268. +     register int j;
  2269. +     if ( IS_RP_EXTERN( rp ) ) {
  2270. +     register struct nlist *sp = e->symtab + rp->r_symbolnum;
  2271. +     char *np = ((sp->n_un.n_strx) ? ( e->stringtab + sp->n_un.n_strx )
  2272. +                       : "<<noname>>" ) ;
  2273. +     if ( SYM_TYPE(sp) == N_UNDF) {
  2274. +         if (sp->n_value == 0) {
  2275. +            for (i = globalcount; --i >= 0 ;)
  2276. +             if (strcmp(globals[i].entryname, np) == 0)
  2277. +             break;
  2278. +         if (i < 0) {
  2279. +             fprintf(stderr, "dofix:  Undefined:  %s\n", np);
  2280. +             e->problems++;
  2281. +         }
  2282. +         }
  2283. +         for ( j = e->newsymcount ;
  2284. +           --j >= 0
  2285. +            && strcmp(e->stringtab + e->newsym[j].n_un.n_strx, np) != 0; ) ;
  2286. +         if (j < 0) {
  2287. +         j = e->newsymcount++;
  2288. +         e->newsym = (struct nlist *)
  2289. +                 safe_realloc( e, (char *) e->newsym,
  2290. +                       e->newsymcount * sizeof *(e->newsym));
  2291. +         bcopy(sp, e->newsym + j, sizeof *sp);
  2292. +         }
  2293. +         if (sp->n_value > e->newsym[j].n_value)
  2294. +         e->newsym[j].n_value = sp->n_value;
  2295. +         rp->r_symbolnum = j;
  2296. +     } /* endif N_UNDF */
  2297. +     else if ( SYM_TYPE(sp) != N_ABS) {
  2298. +         fprintf( stderr,
  2299. +              "dofix:  Relocatable symbol value (%s = %d, type %d)\n",
  2300. +               np, sp->n_value, SYM_TYPE(sp) );
  2301. +         e->problems++;
  2302. +     }
  2303. +     else if (sp->n_value != 0) {
  2304. +         fprintf( stderr, "dofix:  Nonzero symbol value (%s = %d)\n",
  2305. +              np, sp->n_value);
  2306. +         e->problems++;
  2307. +     }
  2308. +     }
  2309. +     return;
  2310. + }
  2311. + /* write new symbol table */
  2312. + WriteNewSym(e, outFD)
  2313. + register struct doload_environment *e;
  2314. + int outFD;
  2315. + {
  2316. +     register int i;
  2317. +     register char *newcp;
  2318. +     long newstringsize;
  2319. +     char *newstrings = NULL;
  2320. +     /* allocate new string table */
  2321. +     for (newstringsize = sizeof newstringsize, i = e->newsymcount; --i >= 0; )
  2322. +     newstringsize += strlen(e->stringtab + e->newsym[i].n_un.n_strx) + 1;
  2323. +     if (doload_trace)
  2324. +     printf( " new symbol count %d, new string size %d\n",
  2325. +         e->newsymcount, newstringsize ) ;
  2326. +     newcp = newstrings = safe_malloc(e, newstringsize);
  2327. +     *(long *)newcp = newstringsize;
  2328. +     newcp += sizeof newstringsize;
  2329. +     /* make a new string table */
  2330. +     for (i = 0; i < e->newsymcount; i++) {
  2331. +     register char *oldcp ;
  2332. +     register int n ;
  2333. +     oldcp = e->stringtab + e->newsym[i].n_un.n_strx ;
  2334. +     n = strlen(oldcp) + 1;
  2335. +     bcopy(oldcp, newcp, n);
  2336. +     e->newsym[i].n_un.n_strx = newcp - newstrings;
  2337. +     newcp += n;
  2338. +     }
  2339. +     /* write symbols and strings */
  2340. +     safe_write( e, outFD, (char *) e->newsym,
  2341. +         e->newsymcount * sizeof (struct nlist) );
  2342. +     safe_write(e, outFD, newstrings, newstringsize);
  2343. +     /* clean up */
  2344. +     safe_free(newstrings);
  2345. +     return;
  2346. + }
  2347. + /* read, fix, and write out module */
  2348. + FixIt(inFD, outFD, EntryPointName)
  2349. + int inFD;            /* open fd for .o file */
  2350. + int outFD;            /* open fd for .do file */
  2351. + char *EntryPointName;        /* entry point name */
  2352. + {
  2353. +     struct doload_environment E;
  2354. +     register struct doload_environment *e;
  2355. +     unsigned long n;    /* number of relocation items */
  2356. +     struct relocation_info *rp;
  2357. +     if (doload_trace)
  2358. +     printf("FixIt(%d, %d, %s)\n", inFD, outFD, EntryPointName);
  2359. +     /* set up environment */
  2360. +     doload_setup(e = &E, inFD, Fix);
  2361. +     if (setjmp(e->errorJump)) {
  2362. +     doload_cleanup(e);
  2363. +     return;
  2364. +     }
  2365. +     /* read module into memory */
  2366. +     doload_read(e);
  2367. +     /* repair relocation tables */
  2368. +     rp = e->rtab;
  2369. +     for ( n = (e->header.a_trsize + e->header.a_drsize)/(sizeof *rp);
  2370. +       n > 0;
  2371. +       n--, rp++) {
  2372. +     FixRelocation(e, rp);
  2373. +     }
  2374. +     /* get entry point */
  2375. +     FixEntryPoint(e, EntryPointName);
  2376. +     /* write out result */
  2377. +     e->header.a_syms = e->newsymcount * sizeof(struct nlist);
  2378. +     safe_write(e, outFD, (char *)&(e->header), (long)sizeof e->header);
  2379. +     if (lseek(outFD, (long)N_TXTOFF(e->header), 0) < 0)
  2380. +     doload_punt(e, "seek to write text failed");
  2381. +     safe_write(e, outFD, e->text, (long)(e->header.a_text + e->header.a_data));
  2382. +     safe_write(e, outFD, (char *)e->rtab,
  2383. +            e->header.a_trsize + e->header.a_drsize);
  2384. +     WriteNewSym(e, outFD);
  2385. +     doload_cleanup(e);
  2386. +     return ;
  2387. + }
  2388. + static char *ComputeOutputFileName (InputFileName, extension)
  2389. + char *InputFileName;
  2390. + char *extension;
  2391. + {
  2392. +     static char name[256];
  2393. +     register char  *p, *q;
  2394. +     char   *ext;
  2395. +  /* copy the input name and look for the last '.' */
  2396. +     for (p = InputFileName, q = name, ext = NULL; *p != '\0';) {
  2397. +     if (*p == '/')        /* ignore period if '/' follows */
  2398. +         p++, q = name, ext = NULL;
  2399. +     else
  2400. +         if ((*q++ = *p++) == '.')
  2401. +         ext = q - 1;
  2402. +     }
  2403. +     if (ext == NULL)
  2404. +     ext = q;
  2405. +     *ext = '\0';
  2406. +  /* overwrite the extension with new extension */
  2407. +     strncat(name, extension, 255);
  2408. +     if (strcmp(InputFileName, name) == 0)
  2409. +     strncat(name, extension, 255);
  2410. +     return name ;
  2411. + }
  2412. + /* main program */
  2413. + main(argc, argp)
  2414. + int argc;
  2415. + char **argp;
  2416. + {
  2417. +     int infd;
  2418. +     int outfd;
  2419. +     int gotcha = 0;
  2420. +     char *outname;
  2421. +     char *EntryPointName = NULL;
  2422. +     while (--argc > 0) {
  2423. +     if (**++argp == '-') {
  2424. +         switch (*++*argp) {
  2425. +         case 'd':
  2426. +         doload_trace++;
  2427. +         break;
  2428. +         case 'e':
  2429. +         if (*++*argp)
  2430. +             EntryPointName = *argp;
  2431. +         else {
  2432. +             EntryPointName = *++argp;
  2433. +             argc--;
  2434. +         }
  2435. +         break;
  2436. +         default:
  2437. +         fprintf(stderr, "dofix:  Unknown switch -%c ignored\n", *argp);
  2438. +         }
  2439. +     }
  2440. +     else {
  2441. +         gotcha++;
  2442. +         outname = ComputeOutputFileName(*argp, ".do");
  2443. +         infd = open(*argp, O_RDONLY, 0);
  2444. +         if (infd < 0)
  2445. +         fprintf(stderr, "dofix:  File %s not found\n", *argp);
  2446. +         else {
  2447. +         outfd = open(outname, O_WRONLY+O_CREAT+O_TRUNC, 0644);
  2448. +         if (outfd < 0) {
  2449. +             fprintf(stderr, "dofix:  Can not write file %s\n", outname);
  2450. +             perror("dofix");
  2451. +         }
  2452. +         else {
  2453. +             FixIt(infd, outfd, EntryPointName);
  2454. +             close(outfd);
  2455. +         }
  2456. +         close(infd);
  2457. +         }
  2458. +     }
  2459. +     }
  2460. +     if (gotcha == 0) {
  2461. +     FixIt(0, 1, EntryPointName);
  2462. +     }
  2463. +     exit(0);
  2464. + }
  2465. diff -cr --new-file andrew.orig/overhead/class/machdep/i386_linux/doload.c andrew/overhead/class/machdep/i386_linux/doload.c
  2466. *** andrew.orig/overhead/class/machdep/i386_linux/doload.c
  2467. --- andrew/overhead/class/machdep/i386_linux/doload.c    Mon Sep  6 19:30:46 1993
  2468. ***************
  2469. *** 0 ****
  2470. --- 1,371 ----
  2471. + /* ********************************************************************** *\
  2472. +  *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
  2473. +  *        For full copyright information see:'andrew/config/COPYRITE'     *
  2474. + \* ********************************************************************** */
  2475. + static char *doload_rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/class/machdep/i386_mach/RCS/doload.c,v 1.2 1991/09/12 17:06:03 bobg Exp $";
  2476. + /* 
  2477. +     doload.c - dynamic loader for class system
  2478. +     Author:  John H Howard - April 4, 1987
  2479. +  */
  2480. + #include <stdio.h>
  2481. + #include <a.out.h>
  2482. + #include <setjmp.h>
  2483. + #include <doload.h>
  2484. + #include <aixfix.h>
  2485. + #include <andrewos.h> /* sys/types.h */
  2486. + #include <sys/stat.h>
  2487. + char *malloc();
  2488. + char *realloc();
  2489. + long lseek();
  2490. + int doload_trace=0;        /* nonzero if debugging */
  2491. + #include "../common/safe.h"
  2492. + /* initialize state */
  2493. + void doload_setup(e, inFD, mode)
  2494. + struct doload_environment *e;
  2495. + int inFD;
  2496. + doload_mode mode;
  2497. + {
  2498. +     e->mode = mode;
  2499. +     e->fd = inFD;
  2500. +     e->problems = 0;
  2501. +     e->text = NULL;
  2502. +     e->rtab = NULL;
  2503. +     e->symtab = NULL;
  2504. +     e->stringtab = NULL;
  2505. +     e->newsym = NULL;
  2506. +     e->newsymcount = 0;
  2507. +     return;
  2508. + }
  2509. + /* tear down environment */
  2510. + void doload_cleanup(e)
  2511. + struct doload_environment *e;
  2512. + {
  2513. +     if (e->problems > 0) {
  2514. +     e->problems = 0;
  2515. +     doload_punt(e, "Errors while processing");
  2516. +     }
  2517. +     safe_free((char *)e->rtab);
  2518. +     safe_free((char *)e->symtab);
  2519. +     safe_free(e->stringtab);
  2520. +     safe_free((char *)e->newsym);
  2521. +     return ;
  2522. + }
  2523. + /* read module into memory */
  2524. + doload_read(e)
  2525. + struct doload_environment *e;
  2526. + {
  2527. +     long stringlen;    /* length of string table */
  2528. +     /* read header */
  2529. +     safe_read(e, (char *)&(e->header), (long)sizeof e->header);
  2530. +     if (e->mode == List)
  2531. +     printf( "\nHEADER\n  magic= %x\n  text = %x\n  data = %x\n\
  2532. +   bss  = %x\n  syms = %x\n  entry= %x\n  trsize=%x\n  drsize=%x\n",
  2533. +         e->header.a_info, e->header.a_text, e->header.a_data,
  2534. +         e->header.a_bss, e->header.a_syms, e->header.a_entry,
  2535. +         e->header.a_trsize, e->header.a_drsize);
  2536. +     if (N_BADMAG(e->header))
  2537. +     doload_punt(e, "file not in loader format");
  2538. +     /* read text plus data */
  2539. +     e->text = safe_malloc( e,
  2540. +          (long)(e->header.a_text + e->header.a_data + e->header.a_bss));
  2541. +     e->data = e->text + e->header.a_text;
  2542. +     safe_lseek(e, (long)N_TXTOFF(e->header), 0);
  2543. +     safe_read(e, e->text, (long)(e->header.a_text + e->header.a_data));
  2544. +     bzero(e->data + e->header.a_data, e->header.a_bss);
  2545. +     /* read relocation information */
  2546. +     if (e->header.a_trsize + e->header.a_drsize > 0) {
  2547. +     long rsize;        /* size of relocation info */
  2548. +     rsize = e->header.a_trsize + e->header.a_drsize;
  2549. +     e->rtab = (struct relocation_info *)safe_malloc(e, rsize);
  2550. +     safe_read(e, (char *)e->rtab, rsize);
  2551. +     }
  2552. +     /* read symbol table */
  2553. +     /* Hope symbol table comes Right after data relocations !! */
  2554. +     e->symtab = (struct nlist *)safe_malloc(e, (long)e->header.a_syms);
  2555. +     safe_read(e, (char *)e->symtab, (long)e->header.a_syms);
  2556. +     /* read string table */
  2557. +     /* Hope string table comes Right after symbol table !! */
  2558. +     if (read(e->fd, (char *)&stringlen, sizeof stringlen) == sizeof stringlen) {
  2559. +     e->stringtab = safe_malloc(e, stringlen);
  2560. +     safe_read( e, e->stringtab + sizeof stringlen,
  2561. +            stringlen - sizeof stringlen);
  2562. +     bcopy((char *)&stringlen, e->stringtab, sizeof stringlen);
  2563. +     }
  2564. + }
  2565. + /* read and relocate module */
  2566. + void *(* doload(inFD, name, bp, lenP, path) )()
  2567. +                 /* or NULL if error */
  2568. + int inFD;            /* open fd for package file */
  2569. + char *name;            /* name of package being loaded */
  2570. + char **bp;            /* base address of package */
  2571. + long *lenP;            /* size of text segment */
  2572. + char *path;            /* Pathname of package being loaded */
  2573. +                 /* Path is used by the MACH loader, not this one */
  2574. + {
  2575. +     struct doload_environment E;
  2576. +     register struct doload_environment *e;
  2577. +     unsigned long n;    /* number of relocation items */
  2578. +     struct relocation_info *rp;
  2579. +     /* set up environment */
  2580. +     doload_setup(e = &E, inFD, Load);
  2581. +     if (setjmp(e->errorJump)) {
  2582. +     doload_cleanup(e);
  2583. +     return NULL;
  2584. +     }
  2585. +     /* read module into memory */
  2586. +     doload_read(e);
  2587. +     /* do relocation */
  2588. +     if (e->header.a_syms)
  2589. +     doload_preset(e);
  2590. +     rp = e->rtab;
  2591. +     for (n = (e->header.a_trsize)/(sizeof *rp); n > 0; n--, rp++) {
  2592. +     doload_relocate(e, e->text + rp->r_address, rp);
  2593. +     }
  2594. +     for (n = (e->header.a_drsize)/(sizeof *rp); n > 0; n--, rp++) {
  2595. +     doload_relocate(e, e->data + rp->r_address, rp);
  2596. +     }
  2597. +     /* all done */
  2598. +     if (doload_trace)
  2599. +     printf( " %s: text = 0x%.8x  data = 0x%.8x  entry = 0x%.8x\n",
  2600. +         name, e->text, e->data, e->text + e->header.a_entry);
  2601. +     if(bp!=NULL) *bp = e->text;
  2602. +     if(lenP!=NULL) *lenP = e->header.a_text;
  2603. +     doload_cleanup(e);
  2604. +     return (void *(*)()) (e->text + e->header.a_entry);
  2605. + }
  2606. + extern struct globaltab {
  2607. +     long entrypoint;    /* entry point value */
  2608. +     char *entryname;    /* symbolic name */
  2609. + } globals[];
  2610. + extern long globalcount;
  2611. + /* preset global symbols */
  2612. + static char *symtypename[] = {"UNDF", "ABS ", "TEXT", "DATA", "BSS ", "????" };
  2613. + char *RelocType(i)
  2614. + int i;
  2615. + {
  2616. +     i = (i & N_TYPE) >> 1;
  2617. +     return symtypename[i <= 4 ? i : 5];
  2618. + }
  2619. + doload_preset(e)
  2620. + register struct doload_environment *e;
  2621. + {
  2622. +     register struct nlist *sp;
  2623. +     register struct nlist *sbound;
  2624. +     sp = e->symtab;
  2625. +     sbound = (struct nlist *)((char *)sp + e->header.a_syms);
  2626. +     for (; sp < sbound; sp++) {
  2627. +     char *np = ((sp->n_un.n_strx)
  2628. +          ? (e->stringtab + sp->n_un.n_strx) : "<<noname>>" ) ;
  2629. +     if (e->mode == List) {
  2630. +         printf( " %.2x %.2x %.4x %.8x  %s %s %s\n",
  2631. +             sp->n_type, sp->n_other, sp->n_desc, sp->n_value,
  2632. +             RelocType(sp->n_type),
  2633. +             ( IS_EXTERN_SYM( sp ) ? "EXT " : "    "),
  2634. +             np );
  2635. +     }
  2636. +     else if ( SYM_TYPE(sp) == N_UNDF) {
  2637. +         register int i;
  2638. +         for (i = globalcount;
  2639. +          --i >= 0 && strcmp(globals[i].entryname, np) != 0; ) ;
  2640. +         if (i >= 0)
  2641. +         sp->n_value = globals[i].entrypoint;
  2642. +         else if (sp->n_value > 0) {
  2643. +                 unsigned long length = sp->n_value;
  2644. +         sp->n_value = (unsigned long)safe_malloc(e, length);
  2645. +                 bzero(sp->n_value, length);
  2646. +         }
  2647. +         else {
  2648. +         fprintf(stderr, "doload:  Undefined symbol: %s\n", np);
  2649. +         e->problems++;
  2650. +         }
  2651. +         sp->n_type = N_ABS + N_EXT;
  2652. +     } /* endif N_UNDF */
  2653. +     }
  2654. + }
  2655. + /* compute relocation adjustment */
  2656. + long adjust(e, tw, rp, format)
  2657. + register struct doload_environment *e;
  2658. + register long tw;
  2659. + register struct relocation_info *rp;
  2660. + char *format;
  2661. + {
  2662. +     if (e->mode == List)
  2663. +     printf("  %s", format);
  2664. +     if (IS_RP_EXTERN( rp )) {
  2665. +     register struct nlist *sp = e->symtab + rp->r_symbolnum;
  2666. +     char *np = ((sp->n_un.n_strx)
  2667. +          ? (e->stringtab + sp->n_un.n_strx) :  "<<noname>>");
  2668. +     if (e->mode == List) {
  2669. +         if (tw)
  2670. +         (void) printf("%x+", tw);
  2671. +     }
  2672. +     if ( SYM_TYPE(sp) == N_UNDF && e->mode == Load)
  2673. +         doload_punt(e,
  2674. +         "Internal botch - should have resolved in doload_preset");
  2675. +     if (e->mode == List)
  2676. +         (void) printf( "%s=%x<%s>", np, sp->n_value,
  2677. +             RelocType(sp->n_type));
  2678. +     else {
  2679. +         tw += sp->n_value;
  2680. +         switch ( SYM_TYPE(sp) ) {
  2681. +         case N_DATA:
  2682. +         case N_BSS:
  2683. +         case N_TEXT:
  2684. +         tw += (long) e->text;
  2685. +         case N_ABS:
  2686. +         break;
  2687. +         case N_UNDF:
  2688. +         if (IS_EXTERN_SYM( sp ))
  2689. +             break;
  2690. +         default:
  2691. +         fprintf(stderr, "doload:  Unknown relocation in symbol.\n");
  2692. +         fprintf( stderr, "  reltab:  %.8x %.6x %.2x\n",
  2693. +              rp->r_address, rp->r_symbolnum, *((char *)rp + 7));
  2694. +         fprintf( stderr,
  2695. +              "  symtab[%.6x]: %.8x %.2x %.2x %.4x %.8x %s\n",
  2696. +              rp->r_symbolnum, sp->n_un.n_strx, sp->n_type,
  2697. +              sp->n_other, sp->n_desc, sp->n_value, np);
  2698. +         e->problems++;
  2699. +         }
  2700. +     }
  2701. +     } /* endif IS_RP_EXTERN( rp ) */
  2702. +     else {
  2703. +     if (e->mode == List)
  2704. +         printf( "%x<%s>", tw,
  2705. +             RelocType(rp->r_symbolnum));
  2706. +     switch (rp->r_symbolnum & N_TYPE)
  2707. +         {
  2708. +         case N_DATA:
  2709. +         case N_BSS:
  2710. +         case N_TEXT:
  2711. +         tw += (long) e->text;
  2712. +         break;
  2713. +         case N_ABS:
  2714. +         if ((tw & 0xf00f0000) == 0xa0080000) {
  2715. +             register int i = (tw >> 20) & 0xFF;
  2716. +             char *np = (i < globalcount)
  2717. +                  ? globals[i].entryname : "**INDEX TOO LARGE**";
  2718. +             if (e->mode == List)
  2719. +             printf("  >>%s<<", np);
  2720. +             else if (i >= globalcount) {
  2721. +             fprintf(stderr, "doload:  special index invalid\n");
  2722. +             e->problems++;
  2723. +             }
  2724. +             else {
  2725. +             tw = globals[i].entrypoint;
  2726. +             }
  2727. +         }
  2728. +         break;
  2729. +         default:
  2730. +         doload_punt(e, "unknown symbol type");
  2731. +     } /* end switch */
  2732. +     } /* end else */
  2733. +     return tw;
  2734. + }
  2735. + /* relocate one item */
  2736. + doload_relocate(e, cp, rp)
  2737. + register struct doload_environment *e;
  2738. + register char *cp;
  2739. + register struct relocation_info *rp;
  2740. + {
  2741. +     register long tw;
  2742. +     switch (RP_LENGTH( rp )) {
  2743. +     case 0:    /* 1 byte */
  2744. +     tw = *cp;
  2745. +       if (IS_RP_PC_REL( rp )) {
  2746. +           tw += rp->r_address;
  2747. +           tw = adjust(e, tw, rp, "(pcrel)");
  2748. +           tw -= (long)cp;
  2749. +       }
  2750. +       else
  2751. +         tw = adjust(e, tw, rp, "(char)");
  2752. +     if (e->mode == Load) {
  2753. +         if (tw < -128 || tw > 127)
  2754. +         doload_punt(e, "byte displacement overflow");
  2755. +         *cp = tw;
  2756. +     }
  2757. +     break;
  2758. +     case 1:    /* 2 bytes */
  2759. +     tw = *(short *)cp;
  2760. +     if (IS_RP_PC_REL( rp ))
  2761. +         doload_punt(e, "pc relative short relocation");
  2762. +     tw = adjust(e, tw, rp, "(short)");
  2763. +     if (e->mode == Load) {
  2764. +         if (tw < -32768 || tw > 32767)
  2765. +         doload_punt(e, "short displacement overflow");
  2766. +         *(short *)cp = tw;
  2767. +     }
  2768. +     break;
  2769. +     case 2:    /* 4 bytes */
  2770. +     tw = *(long *)cp;
  2771. +     if (IS_RP_PC_REL( rp )) {
  2772. +     /* the following kludge is taken from 4.2A's ld.c */
  2773. +         tw += rp->r_address;
  2774. +         tw = adjust(e, tw, rp, "(pcrel)");
  2775. +         tw -= (long)cp;
  2776. +     } /* if IS_RP_PC_REL( rp ) */
  2777. +     else
  2778. +     {
  2779. +         tw = adjust(e, tw, rp, "(word)");
  2780. +     }
  2781. +     if (e->mode == Load) {
  2782. +         *(long *)cp = tw;
  2783. +     }
  2784. +     break;
  2785. +     default:
  2786. +     doload_punt(e, "unknown relocation length");
  2787. +     }
  2788. +     return ;
  2789. + }
  2790. diff -cr --new-file andrew.orig/overhead/class/machdep/i386_linux/doload.h andrew/overhead/class/machdep/i386_linux/doload.h
  2791. *** andrew.orig/overhead/class/machdep/i386_linux/doload.h
  2792. --- andrew/overhead/class/machdep/i386_linux/doload.h    Mon Sep  6 19:30:46 1993
  2793. ***************
  2794. *** 0 ****
  2795. --- 1,41 ----
  2796. + /* ********************************************************************** *\
  2797. +  *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
  2798. +  *        For full copyright information see:'andrew/config/COPYRITE'     *
  2799. + \* ********************************************************************** */
  2800. + /* 
  2801. +     doload.h - environment for dynamic loader
  2802. +     Author:  John H Howard - April 9, 1987
  2803. +  */
  2804. + /* here is the state during a load */
  2805. + typedef enum doload_mode_enum {
  2806. +     Load,            /* .. loading .do file */
  2807. +     List,            /* .. listing .do or .o file */
  2808. +     Fix            /* .. converting .o to .do file */
  2809. + } doload_mode;
  2810. + struct doload_environment {
  2811. +     doload_mode mode;        /* operating mode */
  2812. +     int fd;            /* input file descriptor */
  2813. +     jmp_buf errorJump;        /* error exit */
  2814. +     int problems;        /* count of problems encountered */
  2815. +     struct exec header;        /* header at beginning of a.out file */
  2816. +     char *text;            /* text segment */
  2817. +     char *data;            /* data segment */
  2818. +     struct relocation_info *rtab; /* relocation table */
  2819. +     struct nlist *symtab;    /* symbol table */
  2820. +     char *stringtab;        /* string table */
  2821. +     struct nlist *newsym;    /* replacement symbol table */
  2822. +     int newsymcount;        /* number of new symbols */
  2823. + };
  2824. + extern int doload_trace;
  2825. + #define doload_extension ".do"
  2826. + extern void *(*doload() )();
  2827. diff -cr --new-file andrew.orig/overhead/class/machdep/i386_linux/entry.spp andrew/overhead/class/machdep/i386_linux/entry.spp
  2828. *** andrew.orig/overhead/class/machdep/i386_linux/entry.spp
  2829. --- andrew/overhead/class/machdep/i386_linux/entry.spp    Mon Sep  6 19:30:46 1993
  2830. ***************
  2831. *** 0 ****
  2832. --- 1,858 ----
  2833. + /* ********************************************************************** *\
  2834. +  *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
  2835. +  *        For full copyright information see:'andrew/config/COPYRITE'     *
  2836. + \* ********************************************************************** */
  2837. + /* 
  2838. +  * 
  2839. +  * ******
  2840. +  *
  2841. +  * PLEASE NOTE:
  2842. +  * 
  2843. +  * This file is designed to be run through the C preprocessor before
  2844. +  * being passed to the assembler.  
  2845. +  * 
  2846. +  * *****
  2847. +  * 
  2848. +  * This is the code that breaks a link to_ClassEntry routines
  2849. +  * and sets it to the set of routines given by the information
  2850. +  * pointed to by the first parameter.  That structure contains the 
  2851. +  * information needed to locate a module and verify that the module
  2852. +  * is the correct version along with some other infomation about the
  2853. +  * module.
  2854. +  *
  2855. +  * Each_ClassEntry routine must provide a way to get an index indicating
  2856. +  * which entry was called.  On the RT this is done by placing the index in
  2857. +  * the static data block that is passed to the procedure in R0.  For other
  2858. +  * machines this would be done by having each entry point set a register
  2859. +  * to the index and then branching to the main body of this code.
  2860. +  *
  2861. +  * The main body of the code then does the following:
  2862. +  * -- Calls the class_Lookup procedure passing in the structure
  2863. +  *    pointed to by the first parameter.
  2864. +  * -- class_Lookup returns the base address of the procedure table
  2865. +  *    for the module.
  2866. +  * -- Use the index provided by the_ClassEntry to look up the routine.
  2867. +  * -- Reset the stack to the state it was in before the call to this code.
  2868. +  * -- Make any adjustments to the stack, registers, etc. to make the
  2869. +  *    called routine think that it was called directly.
  2870. +  * -- Branch (NOT a subroutine jump) to the real routine.  This may be
  2871. +  *    done differently for some new machine.
  2872. +  *
  2873. +  * NOTE1: There are currently 150 entry points.  This was an arbitrary choice
  2874. +  * and can be changed as appropriate.  If it is changed, definitions
  2875. +  * in class.h must also be changed.
  2876. +  */
  2877. + /* 
  2878. +  * Data section.  Only used here to get access to class_ErrorReturnValue.
  2879. +  */
  2880. +     .data
  2881. +     .globl    _class_ErrorReturnValue    /* external used to get class_Lookup status */
  2882. + /*
  2883. +  * All the entry points come to this label.  When they get
  2884. +  * here the stack is intact and EAX contains the index.
  2885. +  */
  2886. +     .text
  2887. +     .globl _class_Lookup        /* used to dynamically load and bind code */
  2888. + L000:
  2889. + /*
  2890. +  * While in this routine (after the first few instructions) the stack 
  2891. +  * looks like this:
  2892. +  * 
  2893. +  * EBP + 0x28        parm...        <-- EBP points here at entry time
  2894. +  * EBP + 0x24        parm4
  2895. +  * EBP + 0x20        parm3
  2896. +  * EBP + 0x1C        parm2
  2897. +  * EBP + 0x08        parm1        (pointer to header)
  2898. +  * EBP + 0x04        return address
  2899. +  * EBP + 0x00        saved EBP    <-- EBP during execution
  2900. +  * EBP - 0x04        passed parm    (passed index)
  2901. +  * EBP - 0x08        passed parm    (pointer to header)
  2902. +  * 
  2903. +  */
  2904. +     /* start of code...set up stack, etc. */
  2905. +     pushl    %ebp
  2906. +     movl    %esp, %ebp
  2907. +     /* set up registers and call to class_Lookup */
  2908. +     pushl    %eax            /* index */
  2909. +     pushl    0x08(%ebp)        /* pointer to header */
  2910. +     call    _class_Lookup
  2911. +     /* back from class_Lookup */
  2912. +     cmpl    $0, %eax        /* lookup failed? */
  2913. +     je    ErrorExit        /* yes, return class_ErrorReturnValue */
  2914. +                 /* no, jump to the proper class routine */
  2915. +     /* non-zero value from class_Lookup is base of proc table */
  2916. +     movl    -0x04(%ebp), %edx    /* get back index */
  2917. +     movl    (%eax, %edx, 4), %eax    /* get routine address in %eax using the funky addr modes */
  2918. +     leave                /* fix up stack */
  2919. +     jmp    *%eax            /* jump to the routine */
  2920. + ErrorExit:
  2921. +     /* return the value in class_ErrorReturnValue */
  2922. +     movl    _class_ErrorReturnValue, %eax    /* get return value in correct place */
  2923. +     leave                /* restore stack */
  2924. +     ret                /* and return to caller */
  2925. + /*
  2926. +  * and now come the entry points.
  2927. +  */
  2928. +     .globl    _ClassEntry0
  2929. + _ClassEntry0:
  2930. +     movl    $0, %eax
  2931. +     jmp    L000
  2932. +     .globl    _ClassEntry1
  2933. + _ClassEntry1:
  2934. +     movl    $1, %eax
  2935. +     jmp    L000
  2936. +     .globl    _ClassEntry2
  2937. + _ClassEntry2:
  2938. +     movl    $2, %eax
  2939. +     jmp    L000
  2940. +     .globl    _ClassEntry3
  2941. + _ClassEntry3:
  2942. +     movl    $3, %eax
  2943. +     jmp    L000
  2944. +     .globl    _ClassEntry4
  2945. + _ClassEntry4:
  2946. +     movl    $4, %eax
  2947. +     jmp    L000
  2948. +     .globl    _ClassEntry5
  2949. + _ClassEntry5:
  2950. +     movl    $5, %eax
  2951. +     jmp    L000
  2952. +     .globl    _ClassEntry6
  2953. + _ClassEntry6:
  2954. +     movl    $6, %eax
  2955. +     jmp    L000
  2956. +     .globl    _ClassEntry7
  2957. + _ClassEntry7:
  2958. +     movl    $7, %eax
  2959. +     jmp    L000
  2960. +     .globl    _ClassEntry8
  2961. + _ClassEntry8:
  2962. +     movl    $8, %eax
  2963. +     jmp    L000
  2964. +     .globl    _ClassEntry9
  2965. + _ClassEntry9:
  2966. +     movl    $9, %eax
  2967. +     jmp    L000
  2968. +     .globl    _ClassEntry10
  2969. + _ClassEntry10:
  2970. +     movl    $10, %eax
  2971. +     jmp    L000
  2972. +     .globl    _ClassEntry11
  2973. + _ClassEntry11:
  2974. +     movl    $11, %eax
  2975. +     jmp    L000
  2976. +     .globl    _ClassEntry12
  2977. + _ClassEntry12:
  2978. +     movl    $12, %eax
  2979. +     jmp    L000
  2980. +     .globl    _ClassEntry13
  2981. + _ClassEntry13:
  2982. +     movl    $13, %eax
  2983. +     jmp    L000
  2984. +     .globl    _ClassEntry14
  2985. + _ClassEntry14:
  2986. +     movl    $14, %eax
  2987. +     jmp    L000
  2988. +     .globl    _ClassEntry15
  2989. + _ClassEntry15:
  2990. +     movl    $15, %eax
  2991. +     jmp    L000
  2992. +     .globl    _ClassEntry16
  2993. + _ClassEntry16:
  2994. +     movl    $16, %eax
  2995. +     jmp    L000
  2996. +     .globl    _ClassEntry17
  2997. + _ClassEntry17:
  2998. +     movl    $17, %eax
  2999. +     jmp    L000
  3000. +     .globl    _ClassEntry18
  3001. + _ClassEntry18:
  3002. +     movl    $18, %eax
  3003. +     jmp    L000
  3004. +     .globl    _ClassEntry19
  3005. + _ClassEntry19:
  3006. +     movl    $19, %eax
  3007. +     jmp    L000
  3008. +     .globl    _ClassEntry20
  3009. + _ClassEntry20:
  3010. +     movl    $20, %eax
  3011. +     jmp    L000
  3012. +     .globl    _ClassEntry21
  3013. + _ClassEntry21:
  3014. +     movl    $21, %eax
  3015. +     jmp    L000
  3016. +     .globl    _ClassEntry22
  3017. + _ClassEntry22:
  3018. +     movl    $22, %eax
  3019. +     jmp    L000
  3020. +     .globl    _ClassEntry23
  3021. + _ClassEntry23:
  3022. +     movl    $23, %eax
  3023. +     jmp    L000
  3024. +     .globl    _ClassEntry24
  3025. + _ClassEntry24:
  3026. +     movl    $24, %eax
  3027. +     jmp    L000
  3028. +     .globl    _ClassEntry25
  3029. + _ClassEntry25:
  3030. +     movl    $25, %eax
  3031. +     jmp    L000
  3032. +     .globl    _ClassEntry26
  3033. + _ClassEntry26:
  3034. +     movl    $26, %eax
  3035. +     jmp    L000
  3036. +     .globl    _ClassEntry27
  3037. + _ClassEntry27:
  3038. +     movl    $27, %eax
  3039. +     jmp    L000
  3040. +     .globl    _ClassEntry28
  3041. + _ClassEntry28:
  3042. +     movl    $28, %eax
  3043. +     jmp    L000
  3044. +     .globl    _ClassEntry29
  3045. + _ClassEntry29:
  3046. +     movl    $29, %eax
  3047. +     jmp    L000
  3048. +     .globl    _ClassEntry30
  3049. + _ClassEntry30:
  3050. +     movl    $30, %eax
  3051. +     jmp    L000
  3052. +     .globl    _ClassEntry31
  3053. + _ClassEntry31:
  3054. +     movl    $31, %eax
  3055. +     jmp    L000
  3056. +     .globl    _ClassEntry32
  3057. + _ClassEntry32:
  3058. +     movl    $32, %eax
  3059. +     jmp    L000
  3060. +     .globl    _ClassEntry33
  3061. + _ClassEntry33:
  3062. +     movl    $33, %eax
  3063. +     jmp    L000
  3064. +     .globl    _ClassEntry34
  3065. + _ClassEntry34:
  3066. +     movl    $34, %eax
  3067. +     jmp    L000
  3068. +     .globl    _ClassEntry35
  3069. + _ClassEntry35:
  3070. +     movl    $35, %eax
  3071. +     jmp    L000
  3072. +     .globl    _ClassEntry36
  3073. + _ClassEntry36:
  3074. +     movl    $36, %eax
  3075. +     jmp    L000
  3076. +     .globl    _ClassEntry37
  3077. + _ClassEntry37:
  3078. +     movl    $37, %eax
  3079. +     jmp    L000
  3080. +     .globl    _ClassEntry38
  3081. + _ClassEntry38:
  3082. +     movl    $38, %eax
  3083. +     jmp    L000
  3084. +     .globl    _ClassEntry39
  3085. + _ClassEntry39:
  3086. +     movl    $39, %eax
  3087. +     jmp    L000
  3088. +     .globl    _ClassEntry40
  3089. + _ClassEntry40:
  3090. +     movl    $40, %eax
  3091. +     jmp    L000
  3092. +     .globl    _ClassEntry41
  3093. + _ClassEntry41:
  3094. +     movl    $41, %eax
  3095. +     jmp    L000
  3096. +     .globl    _ClassEntry42
  3097. + _ClassEntry42:
  3098. +     movl    $42, %eax
  3099. +     jmp    L000
  3100. +     .globl    _ClassEntry43
  3101. + _ClassEntry43:
  3102. +     movl    $43, %eax
  3103. +     jmp    L000
  3104. +     .globl    _ClassEntry44
  3105. + _ClassEntry44:
  3106. +     movl    $44, %eax
  3107. +     jmp    L000
  3108. +     .globl    _ClassEntry45
  3109. + _ClassEntry45:
  3110. +     movl    $45, %eax
  3111. +     jmp    L000
  3112. +     .globl    _ClassEntry46
  3113. + _ClassEntry46:
  3114. +     movl    $46, %eax
  3115. +     jmp    L000
  3116. +     .globl    _ClassEntry47
  3117. + _ClassEntry47:
  3118. +     movl    $47, %eax
  3119. +     jmp    L000
  3120. +     .globl    _ClassEntry48
  3121. + _ClassEntry48:
  3122. +     movl    $48, %eax
  3123. +     jmp    L000
  3124. +     .globl    _ClassEntry49
  3125. + _ClassEntry49:
  3126. +     movl    $49, %eax
  3127. +     jmp    L000
  3128. +     .globl    _ClassEntry50
  3129. + _ClassEntry50:
  3130. +     movl    $50, %eax
  3131. +     jmp    L000
  3132. +     .globl    _ClassEntry51
  3133. + _ClassEntry51:
  3134. +     movl    $51, %eax
  3135. +     jmp    L000
  3136. +     .globl    _ClassEntry52
  3137. + _ClassEntry52:
  3138. +     movl    $52, %eax
  3139. +     jmp    L000
  3140. +     .globl    _ClassEntry53
  3141. + _ClassEntry53:
  3142. +     movl    $53, %eax
  3143. +     jmp    L000
  3144. +     .globl    _ClassEntry54
  3145. + _ClassEntry54:
  3146. +     movl    $54, %eax
  3147. +     jmp    L000
  3148. +     .globl    _ClassEntry55
  3149. + _ClassEntry55:
  3150. +     movl    $55, %eax
  3151. +     jmp    L000
  3152. +     .globl    _ClassEntry56
  3153. + _ClassEntry56:
  3154. +     movl    $56, %eax
  3155. +     jmp    L000
  3156. +     .globl    _ClassEntry57
  3157. + _ClassEntry57:
  3158. +     movl    $57, %eax
  3159. +     jmp    L000
  3160. +     .globl    _ClassEntry58
  3161. + _ClassEntry58:
  3162. +     movl    $58, %eax
  3163. +     jmp    L000
  3164. +     .globl    _ClassEntry59
  3165. + _ClassEntry59:
  3166. +     movl    $59, %eax
  3167. +     jmp    L000
  3168. +     .globl    _ClassEntry60
  3169. + _ClassEntry60:
  3170. +     movl    $60, %eax
  3171. +     jmp    L000
  3172. +     .globl    _ClassEntry61
  3173. + _ClassEntry61:
  3174. +     movl    $61, %eax
  3175. +     jmp    L000
  3176. +     .globl    _ClassEntry62
  3177. + _ClassEntry62:
  3178. +     movl    $62, %eax
  3179. +     jmp    L000
  3180. +     .globl    _ClassEntry63
  3181. + _ClassEntry63:
  3182. +     movl    $63, %eax
  3183. +     jmp    L000
  3184. +     .globl    _ClassEntry64
  3185. + _ClassEntry64:
  3186. +     movl    $64, %eax
  3187. +     jmp    L000
  3188. +     .globl    _ClassEntry65
  3189. + _ClassEntry65:
  3190. +     movl    $65, %eax
  3191. +     jmp    L000
  3192. +     .globl    _ClassEntry66
  3193. + _ClassEntry66:
  3194. +     movl    $66, %eax
  3195. +     jmp    L000
  3196. +     .globl    _ClassEntry67
  3197. + _ClassEntry67:
  3198. +     movl    $67, %eax
  3199. +     jmp    L000
  3200. +     .globl    _ClassEntry68
  3201. + _ClassEntry68:
  3202. +     movl    $68, %eax
  3203. +     jmp    L000
  3204. +     .globl    _ClassEntry69
  3205. + _ClassEntry69:
  3206. +     movl    $69, %eax
  3207. +     jmp    L000
  3208. +     .globl    _ClassEntry70
  3209. + _ClassEntry70:
  3210. +     movl    $70, %eax
  3211. +     jmp    L000
  3212. +     .globl    _ClassEntry71
  3213. + _ClassEntry71:
  3214. +     movl    $71, %eax
  3215. +     jmp    L000
  3216. +     .globl    _ClassEntry72
  3217. + _ClassEntry72:
  3218. +     movl    $72, %eax
  3219. +     jmp    L000
  3220. +     .globl    _ClassEntry73
  3221. + _ClassEntry73:
  3222. +     movl    $73, %eax
  3223. +     jmp    L000
  3224. +     .globl    _ClassEntry74
  3225. + _ClassEntry74:
  3226. +     movl    $74, %eax
  3227. +     jmp    L000
  3228. +     .globl    _ClassEntry75
  3229. + _ClassEntry75:
  3230. +     movl    $75, %eax
  3231. +     jmp    L000
  3232. +     .globl    _ClassEntry76
  3233. + _ClassEntry76:
  3234. +     movl    $76, %eax
  3235. +     jmp    L000
  3236. +     .globl    _ClassEntry77
  3237. + _ClassEntry77:
  3238. +     movl    $77, %eax
  3239. +     jmp    L000
  3240. +     .globl    _ClassEntry78
  3241. + _ClassEntry78:
  3242. +     movl    $78, %eax
  3243. +     jmp    L000
  3244. +     .globl    _ClassEntry79
  3245. + _ClassEntry79:
  3246. +     movl    $79, %eax
  3247. +     jmp    L000
  3248. +     .globl    _ClassEntry80
  3249. + _ClassEntry80:
  3250. +     movl    $80, %eax
  3251. +     jmp    L000
  3252. +     .globl    _ClassEntry81
  3253. + _ClassEntry81:
  3254. +     movl    $81, %eax
  3255. +     jmp    L000
  3256. +     .globl    _ClassEntry82
  3257. + _ClassEntry82:
  3258. +     movl    $82, %eax
  3259. +     jmp    L000
  3260. +     .globl    _ClassEntry83
  3261. + _ClassEntry83:
  3262. +     movl    $83, %eax
  3263. +     jmp    L000
  3264. +     .globl    _ClassEntry84
  3265. + _ClassEntry84:
  3266. +     movl    $84, %eax
  3267. +     jmp    L000
  3268. +     .globl    _ClassEntry85
  3269. + _ClassEntry85:
  3270. +     movl    $85, %eax
  3271. +     jmp    L000
  3272. +     .globl    _ClassEntry86
  3273. + _ClassEntry86:
  3274. +     movl    $86, %eax
  3275. +     jmp    L000
  3276. +     .globl    _ClassEntry87
  3277. + _ClassEntry87:
  3278. +     movl    $87, %eax
  3279. +     jmp    L000
  3280. +     .globl    _ClassEntry88
  3281. + _ClassEntry88:
  3282. +     movl    $88, %eax
  3283. +     jmp    L000
  3284. +     .globl    _ClassEntry89
  3285. + _ClassEntry89:
  3286. +     movl    $89, %eax
  3287. +     jmp    L000
  3288. +     .globl    _ClassEntry90
  3289. + _ClassEntry90:
  3290. +     movl    $90, %eax
  3291. +     jmp    L000
  3292. +     .globl    _ClassEntry91
  3293. + _ClassEntry91:
  3294. +     movl    $91, %eax
  3295. +     jmp    L000
  3296. +     .globl    _ClassEntry92
  3297. + _ClassEntry92:
  3298. +     movl    $92, %eax
  3299. +     jmp    L000
  3300. +     .globl    _ClassEntry93
  3301. + _ClassEntry93:
  3302. +     movl    $93, %eax
  3303. +     jmp    L000
  3304. +     .globl    _ClassEntry94
  3305. + _ClassEntry94:
  3306. +     movl    $94, %eax
  3307. +     jmp    L000
  3308. +     .globl    _ClassEntry95
  3309. + _ClassEntry95:
  3310. +     movl    $95, %eax
  3311. +     jmp    L000
  3312. +     .globl    _ClassEntry96
  3313. + _ClassEntry96:
  3314. +     movl    $96, %eax
  3315. +     jmp    L000
  3316. +     .globl    _ClassEntry97
  3317. + _ClassEntry97:
  3318. +     movl    $97, %eax
  3319. +     jmp    L000
  3320. +     .globl    _ClassEntry98
  3321. + _ClassEntry98:
  3322. +     movl    $98, %eax
  3323. +     jmp    L000
  3324. +     .globl    _ClassEntry99
  3325. + _ClassEntry99:
  3326. +     movl    $99, %eax
  3327. +     jmp    L000
  3328. +     .globl    _ClassEntry100
  3329. + _ClassEntry100:
  3330. +     movl    $100, %eax
  3331. +     jmp    L000
  3332. +     .globl    _ClassEntry101
  3333. + _ClassEntry101:
  3334. +     movl    $101, %eax
  3335. +     jmp    L000
  3336. +     .globl    _ClassEntry102
  3337. + _ClassEntry102:
  3338. +     movl    $102, %eax
  3339. +     jmp    L000
  3340. +     .globl    _ClassEntry103
  3341. + _ClassEntry103:
  3342. +     movl    $103, %eax
  3343. +     jmp    L000
  3344. +     .globl    _ClassEntry104
  3345. + _ClassEntry104:
  3346. +     movl    $104, %eax
  3347. +     jmp    L000
  3348. +     .globl    _ClassEntry105
  3349. + _ClassEntry105:
  3350. +     movl    $105, %eax
  3351. +     jmp    L000
  3352. +     .globl    _ClassEntry106
  3353. + _ClassEntry106:
  3354. +     movl    $106, %eax
  3355. +     jmp    L000
  3356. +     .globl    _ClassEntry107
  3357. + _ClassEntry107:
  3358. +     movl    $107, %eax
  3359. +     jmp    L000
  3360. +     .globl    _ClassEntry108
  3361. + _ClassEntry108:
  3362. +     movl    $108, %eax
  3363. +     jmp    L000
  3364. +     .globl    _ClassEntry109
  3365. + _ClassEntry109:
  3366. +     movl    $109, %eax
  3367. +     jmp    L000
  3368. +     .globl    _ClassEntry110
  3369. + _ClassEntry110:
  3370. +     movl    $110, %eax
  3371. +     jmp    L000
  3372. +     .globl    _ClassEntry111
  3373. + _ClassEntry111:
  3374. +     movl    $111, %eax
  3375. +     jmp    L000
  3376. +     .globl    _ClassEntry112
  3377. + _ClassEntry112:
  3378. +     movl    $112, %eax
  3379. +     jmp    L000
  3380. +     .globl    _ClassEntry113
  3381. + _ClassEntry113:
  3382. +     movl    $113, %eax
  3383. +     jmp    L000
  3384. +     .globl    _ClassEntry114
  3385. + _ClassEntry114:
  3386. +     movl    $114, %eax
  3387. +     jmp    L000
  3388. +     .globl    _ClassEntry115
  3389. + _ClassEntry115:
  3390. +     movl    $115, %eax
  3391. +     jmp    L000
  3392. +     .globl    _ClassEntry116
  3393. + _ClassEntry116:
  3394. +     movl    $116, %eax
  3395. +     jmp    L000
  3396. +     .globl    _ClassEntry117
  3397. + _ClassEntry117:
  3398. +     movl    $117, %eax
  3399. +     jmp    L000
  3400. +     .globl    _ClassEntry118
  3401. + _ClassEntry118:
  3402. +     movl    $118, %eax
  3403. +     jmp    L000
  3404. +     .globl    _ClassEntry119
  3405. + _ClassEntry119:
  3406. +     movl    $119, %eax
  3407. +     jmp    L000
  3408. +     .globl    _ClassEntry120
  3409. + _ClassEntry120:
  3410. +     movl    $120, %eax
  3411. +     jmp    L000
  3412. +     .globl    _ClassEntry121
  3413. + _ClassEntry121:
  3414. +     movl    $121, %eax
  3415. +     jmp    L000
  3416. +     .globl    _ClassEntry122
  3417. + _ClassEntry122:
  3418. +     movl    $122, %eax
  3419. +     jmp    L000
  3420. +     .globl    _ClassEntry123
  3421. + _ClassEntry123:
  3422. +     movl    $123, %eax
  3423. +     jmp    L000
  3424. +     .globl    _ClassEntry124
  3425. + _ClassEntry124:
  3426. +     movl    $124, %eax
  3427. +     jmp    L000
  3428. +     .globl    _ClassEntry125
  3429. + _ClassEntry125:
  3430. +     movl    $125, %eax
  3431. +     jmp    L000
  3432. +     .globl    _ClassEntry126
  3433. + _ClassEntry126:
  3434. +     movl    $126, %eax
  3435. +     jmp    L000
  3436. +     .globl    _ClassEntry127
  3437. + _ClassEntry127:
  3438. +     movl    $127, %eax
  3439. +     jmp    L000
  3440. +     .globl    _ClassEntry128
  3441. + _ClassEntry128:
  3442. +     movl    $128, %eax
  3443. +     jmp    L000
  3444. +     .globl    _ClassEntry129
  3445. + _ClassEntry129:
  3446. +     movl    $129, %eax
  3447. +     jmp    L000
  3448. +     .globl    _ClassEntry130
  3449. + _ClassEntry130:
  3450. +     movl    $130, %eax
  3451. +     jmp    L000
  3452. +     .globl    _ClassEntry131
  3453. + _ClassEntry131:
  3454. +     movl    $131, %eax
  3455. +     jmp    L000
  3456. +     .globl    _ClassEntry132
  3457. + _ClassEntry132:
  3458. +     movl    $132, %eax
  3459. +     jmp    L000
  3460. +     .globl    _ClassEntry133
  3461. + _ClassEntry133:
  3462. +     movl    $133, %eax
  3463. +     jmp    L000
  3464. +     .globl    _ClassEntry134
  3465. + _ClassEntry134:
  3466. +     movl    $134, %eax
  3467. +     jmp    L000
  3468. +     .globl    _ClassEntry135
  3469. + _ClassEntry135:
  3470. +     movl    $135, %eax
  3471. +     jmp    L000
  3472. +     .globl    _ClassEntry136
  3473. + _ClassEntry136:
  3474. +     movl    $136, %eax
  3475. +     jmp    L000
  3476. +     .globl    _ClassEntry137
  3477. + _ClassEntry137:
  3478. +     movl    $137, %eax
  3479. +     jmp    L000
  3480. +     .globl    _ClassEntry138
  3481. + _ClassEntry138:
  3482. +     movl    $138, %eax
  3483. +     jmp    L000
  3484. +     .globl    _ClassEntry139
  3485. + _ClassEntry139:
  3486. +     movl    $139, %eax
  3487. +     jmp    L000
  3488. +     .globl    _ClassEntry140
  3489. + _ClassEntry140:
  3490. +     movl    $140, %eax
  3491. +     jmp    L000
  3492. +     .globl    _ClassEntry141
  3493. + _ClassEntry141:
  3494. +     movl    $141, %eax
  3495. +     jmp    L000
  3496. +     .globl    _ClassEntry142
  3497. + _ClassEntry142:
  3498. +     movl    $142, %eax
  3499. +     jmp    L000
  3500. +     .globl    _ClassEntry143
  3501. + _ClassEntry143:
  3502. +     movl    $143, %eax
  3503. +     jmp    L000
  3504. +     .globl    _ClassEntry144
  3505. + _ClassEntry144:
  3506. +     movl    $144, %eax
  3507. +     jmp    L000
  3508. +     .globl    _ClassEntry145
  3509. + _ClassEntry145:
  3510. +     movl    $145, %eax
  3511. +     jmp    L000
  3512. +     .globl    _ClassEntry146
  3513. + _ClassEntry146:
  3514. +     movl    $146, %eax
  3515. +     jmp    L000
  3516. +     .globl    _ClassEntry147
  3517. + _ClassEntry147:
  3518. +     movl    $147, %eax
  3519. +     jmp    L000
  3520. +     .globl    _ClassEntry148
  3521. + _ClassEntry148:
  3522. +     movl    $148, %eax
  3523. +     jmp    L000
  3524. +     .globl    _ClassEntry149
  3525. + _ClassEntry149:
  3526. +     movl    $149, %eax
  3527. +     jmp    L000
  3528. diff -cr --new-file andrew.orig/overhead/class/machdep/i386_linux/getlist.awk andrew/overhead/class/machdep/i386_linux/getlist.awk
  3529. *** andrew.orig/overhead/class/machdep/i386_linux/getlist.awk
  3530. --- andrew/overhead/class/machdep/i386_linux/getlist.awk    Mon Sep  6 19:30:46 1993
  3531. ***************
  3532. *** 0 ****
  3533. --- 1,173 ----
  3534. + ## ###################################################################### ##
  3535. + ##         Copyright IBM Corporation 1988,1991 - All Rights Reserved      ##
  3536. + ##        For full copyright information see:'andrew/config/COPYRITE'     ##
  3537. + ## ###################################################################### ##
  3538. + # awk script to list all modules and entry points from a library which are
  3539. + # needed (via transitive closure) for a given list of basic entry points
  3540. + # the input to this awk script should be generated by:  nm -go /lib/libc.a | tr : " "
  3541. + # data structures used here:
  3542. + #
  3543. + #  definer[entry-point-name] = module-name
  3544. + #  library[entry-point-name] = library-name
  3545. + #  epcount = # entry-point-name's seen so far
  3546. + #  ep[k] = k'th entry-point-name
  3547. + #  refcount[entry-point-name] = number of references by wanted modules
  3548. + #  referrer[entry-point-name.k] = k'th module-name with an undefined reference to this entry-point-name
  3549. + #  want[module-name] = "Y" if this module wanted
  3550. + # search output of nm and set up definers and referrers
  3551. + / [ATDBC] / {
  3552. +     if (definer[$5] == "") {
  3553. +     definer[ep[epcount++] = $5] = $2;
  3554. +     library[$5] = $1;
  3555. +     }
  3556. + }
  3557. + / U / {
  3558. +     referrer[$4 "." refcount[$4]++] = $1 "." $2;
  3559. + }
  3560. + # postprocessing
  3561. + END {
  3562. + # Specify which entry points we definitely want.  Edit this list to add entry points.
  3563. +   want[library["_class_RoutineStruct"] "." definer["_class_RoutineStruct"]] = "Y";
  3564. +   want[library["_class_Error"] "." definer["_class_Error"]] = "Y";
  3565. +   want[library["_ProgramName"] "." definer["_ProgramName"]] = "Y";
  3566. + #  want[library["_class_Header"] "." definer["_class_Header"]] = "Y";
  3567. +   want[library["_class_NewObject"] "." definer["_class_NewObject"]] = "Y";
  3568. +   want[library["_class_Load"] "." definer["_class_Load"]] = "Y";
  3569. +   want[library["_class_IsLoaded"] "." definer["_class_IsLoaded"]] = "Y";
  3570. +   want[library["_class_Lookup"] "." definer["_class_Lookup"]] = "Y";
  3571. +   want[library["_class_IsType"] "." definer["_class_IsType"]] = "Y";
  3572. +   want[library["_class_IsTypeByName"] "." definer["_class_IsTypeByName"]] = "Y";
  3573. +   want[library["_class_EnterInfo"] "." definer["_class_EnterInfo"]] = "Y";
  3574. +   want[library["_class_SetClassPath"] "." definer["_class_SetClassPath"]] = "Y";
  3575. +   want[library["_class_PrependClassPath"] "." definer["_class_PrependClassPath"]] = "Y";
  3576. +   want[library["_class_GetEText"] "." definer["_class_GetEText"]] = "Y";
  3577. +   want[library["_environ"] "." definer["_environ"]] = "Y";
  3578. +   want[library["__exit"] "." definer["__exit"]] = "Y";
  3579. +   want[library["_abort"] "." definer["_abort"]] = "Y";
  3580. +   want[library["_alloca"] "." definer["_alloca"]] = "Y";
  3581. +   want[library["_blt"] "." definer["_blt"]] = "Y";
  3582. +   want[library["_bcopy"] "." definer["_bcopy"]] = "Y";
  3583. +   want[library["_brk"] "." definer["_brk"]] = "Y";
  3584. +   want[library["_bzero"] "." definer["_bzero"]] = "Y";
  3585. +   want[library["_calloc"] "." definer["_calloc"]] = "Y";
  3586. +   want[library["_cfree"] "." definer["_cfree"]] = "Y";
  3587. +   want[library["_errno"] "." definer["_errno"]] = "Y";
  3588. +   want[library["_close"] "." definer["_close"]] = "Y";
  3589. +   want[library["_errno"] "." definer["_errno"]] = "Y";
  3590. +   want[library["_creat"] "." definer["_creat"]] = "Y";
  3591. +   want[library["__ctype_"] "." definer["__ctype_"]] = "Y";
  3592. +   want[library["__doprnt"] "." definer["__doprnt"]] = "Y";
  3593. +   want[library["_ecvt"] "." definer["_ecvt"]] = "Y";
  3594. +   want[library["_fcvt"] "." definer["_fcvt"]] = "Y";
  3595. +   want[library["_sys_errlist"] "." definer["_sys_errlist"]] = "Y";
  3596. +   want[library["_sys_nerr"] "." definer["_sys_nerr"]] = "Y";
  3597. +   want[library["_exit"] "." definer["_exit"]] = "Y";
  3598. +   want[library["_fcntl"] "." definer["_fcntl"]] = "Y";
  3599. +   want[library["__filbuf"] "." definer["__filbuf"]] = "Y";
  3600. +   want[library["__iob"] "." definer["__iob"]] = "Y";
  3601. +   want[library["__cleanup"] "." definer["__cleanup"]] = "Y";
  3602. +   want[library["__flsbuf"] "." definer["__flsbuf"]] = "Y";
  3603. +   want[library["_fclose"] "." definer["_fclose"]] = "Y";
  3604. +   want[library["_fflush"] "." definer["_fflush"]] = "Y";
  3605. +   want[library["_fopen"] "." definer["_fopen"]] = "Y";
  3606. +   want[library["_fprintf"] "." definer["_fprintf"]] = "Y";
  3607. +   want[library["_fread"] "." definer["_fread"]] = "Y";
  3608. +   want[library["_fstat"] "." definer["_fstat"]] = "Y";
  3609. +   want[library["_fwrite"] "." definer["_fwrite"]] = "Y";
  3610. +   want[library["_gcvt"] "." definer["_gcvt"]] = "Y";
  3611. +   want[library["_getdtablesize"] "." definer["_getdtablesize"]] = "Y";
  3612. +   want[library["_getpagesize"] "." definer["_getpagesize"]] = "Y";
  3613. +   want[library["_ioctl"] "." definer["_ioctl"]] = "Y";
  3614. +   want[library["_isatty"] "." definer["_isatty"]] = "Y";
  3615. +   want[library["_lseek"] "." definer["_lseek"]] = "Y";
  3616. +   want[library["_malloc"] "." definer["_malloc"]] = "Y";
  3617. +   want[library["_modf"] "." definer["_modf"]] = "Y";
  3618. +   want[library["_realloc"] "." definer["_realloc"]] = "Y";
  3619. +   want[library["_free"] "." definer["_free"]] = "Y";
  3620. +   want[library["_open"] "." definer["_open"]] = "Y";
  3621. +   want[library["_perror"] "." definer["_perror"]] = "Y";
  3622. +   want[library["_printf"] "." definer["_printf"]] = "Y";
  3623. +   want[library["_read"] "." definer["_read"]] = "Y";
  3624. +   want[library["_sbrk"] "." definer["_sbrk"]] = "Y";
  3625. +   want[library["curbrk"] "." definer["curbrk"]] = "Y";
  3626. +   want[library["_sigvec"] "." definer["_sigvec"]] = "Y";
  3627. +   want[library["_sprintf"] "." definer["_sprintf"]] = "Y";
  3628. +   want[library["_strlen"] "." definer["_strlen"]] = "Y";
  3629. +   want[library["_syscall"] "." definer["_syscall"]] = "Y";
  3630. +   want[library["_write"] "." definer["_write"]] = "Y";
  3631. +   want[library["_writev"] "." definer["_writev"]] = "Y";
  3632. +   want[library["_gethostbyname"] "." definer["_gethostbyname"]] = "Y";
  3633. +   want[library["_gethostbyaddr"] "." definer["_gethostbyaddr"]] = "Y";
  3634. +   want[library["_sethostent"] "." definer["_sethostent"]] = "Y";
  3635. +   want[library["_res_querydomain"] "." definer["_res_querydomain"]] = "Y";
  3636. +   want[library["_res_mkquery"] "." definer["_res_mkquery"]] = "Y";
  3637. +   want[library["_res_send"] "." definer["_res_send"]] = "Y";
  3638. +   want[library["_dn_expand"] "." definer["_dn_expand"]] = "Y";
  3639. +   want[library["_res_init"] "." definer["_res_init"]] = "Y";
  3640. +   want[library["__endhtent"] "." definer["__endhtent"]] = "Y";
  3641. +   want[library["__sethtent"] "." definer["__sethtent"]] = "Y";
  3642. +   want[library["__gethtbyaddr"] "." definer["__gethtbyaddr"]] = "Y";
  3643. +   want[library["__gethtbyname"] "." definer["__gethtbyname"]] = "Y";
  3644. +   want[library["__gethtent"] "." definer["__gethtent"]] = "Y";
  3645. +   want[library["__getrhbyaddr"] "." definer["__getrhbyaddr"]] = "Y";
  3646. +   want[library["_endhostent"] "." definer["_endhostent"]] = "Y";
  3647. +   want[library["_sethostfile"] "." definer["_sethostfile"]] = "Y";
  3648. +   want[library["_hostalias"] "." definer["_hostalias"]] = "Y";
  3649. +   want[library["_res_query"] "." definer["_res_query"]] = "Y";
  3650. +   want[library["_res_search"] "." definer["_res_search"]] = "Y";
  3651. +   want[library["__res_close"] "." definer["__res_close"]] = "Y";
  3652. +   want[library["_fp_query"] "." definer["_fp_query"]] = "Y";
  3653. +   want[library["_p_cdname"] "." definer["_p_cdname"]] = "Y";
  3654. +   want[library["_p_class"] "." definer["_p_class"]] = "Y";
  3655. +   want[library["_p_query"] "." definer["_p_query"]] = "Y";
  3656. +   want[library["_p_rr"] "." definer["_p_rr"]] = "Y";
  3657. +   want[library["_p_type"] "." definer["_p_type"]] = "Y";
  3658. +   want[library["__getlong"] "." definer["__getlong"]] = "Y";
  3659. +   want[library["__getshort"] "." definer["__getshort"]] = "Y";
  3660. +   want[library["_dn_comp"] "." definer["_dn_comp"]] = "Y";
  3661. +   want[library["_dn_skipname"] "." definer["_dn_skipname"]] = "Y";
  3662. +   want[library["_putlong"] "." definer["_putlong"]] = "Y";
  3663. +   want[library["_putshort"] "." definer["_putshort"]] = "Y";
  3664. +   want[library["_strcasecmp"] "." definer["_strcasecmp"]] = "Y";
  3665. +   want[library["_strncasecmp"] "." definer["_strncasecmp"]] = "Y";
  3666. +   want[library["__res_opcodes"] "." definer["__res_opcodes"]] = "Y";
  3667. +   want[library["__res_resultcodes"] "." definer["__res_resultcodes"]] = "Y";
  3668. +   want[library["__res"] "." definer["__res"]] = "Y";
  3669. +   want[library["_h_errno"] "." definer["_h_errno"]] = "Y";
  3670. + # now take transitive closure of wanted modules
  3671. +     for (needmore = "Y"; needmore == "Y"; ) {
  3672. +     needmore = "N";
  3673. +     for ( i = 0; i < epcount; i++) {
  3674. +         if (want[library[ep[i]] "." definer[ep[i]]] != "Y") {
  3675. +         want[library[ep[i]] "." definer[ep[i]]] = "N";
  3676. +         for ( j = 0; j < refcount[ep[i]]; j++ ) {
  3677. +             if (want[referrer[ep[i] "." j]] == "Y") {
  3678. +             want[library[ep[i]] "." definer[ep[i]]] = "Y";
  3679. +             needmore = "Y";
  3680. +             break;
  3681. +             }
  3682. +         }
  3683. +         }
  3684. +     }
  3685. +     }
  3686. + # write out all wanted module name and entry points
  3687. +     for ( i = 0 ; i < epcount ; i++)
  3688. +     if (want[library[ep[i]] "." definer[ep[i]]] == "Y")
  3689. +         printf "%s %s\n", definer[ep[i]], ep[i];
  3690. + }
  3691. diff -cr --new-file andrew.orig/overhead/class/machdep/i386_linux/globals.spp andrew/overhead/class/machdep/i386_linux/globals.spp
  3692. *** andrew.orig/overhead/class/machdep/i386_linux/globals.spp
  3693. --- andrew/overhead/class/machdep/i386_linux/globals.spp    Mon Sep  6 19:30:46 1993
  3694. ***************
  3695. *** 0 ****
  3696. --- 1,77 ----
  3697. + /* ********************************************************************** *\
  3698. +  *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
  3699. +  *        For full copyright information see:'andrew/config/COPYRITE'     *
  3700. + \* ********************************************************************** */
  3701. + /* 
  3702. +  * array of global entry points for dynamic loader
  3703. +  *
  3704. +  * Defines a table of entry points and their names
  3705. +  *
  3706. +  */
  3707. +     .text
  3708. + /* macros which actually define entry points */
  3709. + /*   globalref - direct reference to global symbol x */
  3710. + #ifdef __STDC__
  3711. + #define globalref(x)    .globl x ; \
  3712. +     .set _X_, _X_+1; \
  3713. +     .text;    .long    x,1f;    .data;1: .asciz #x
  3714. + #else
  3715. + #define globalref(x)    .globl x ; \
  3716. +     .set _X_, _X_+1; \
  3717. +            .text;    .long    x,1f;    .data;1: .asciz "x"
  3718. + #endif
  3719. + /*   routine - reference to routine x - _x */
  3720. + #ifdef __STDC__
  3721. + #define routine(x)    globalref(_ ## x)
  3722. + #else
  3723. + #define routine(x)    globalref(_/**/x)
  3724. + #endif
  3725. +     .globl    _globals
  3726. +     .globl    _globalcount
  3727. +     .set    _X_, 0
  3728. + _globals: /* beginning of entry point table */
  3729. + /* from libclass */
  3730. +     globalref(_main)  /* hacked to allow functionality of atk/basics */
  3731. +     globalref(_class_RoutineStruct)
  3732. +     globalref(_class_Error)
  3733. +     routine(class_NewObject)
  3734. +     routine(class_Load)
  3735. +     routine(class_IsLoaded)
  3736. +     routine(class_Lookup)
  3737. +     routine(class_IsType)
  3738. +     routine(class_IsTypeByName)
  3739. +     routine(class_EnterInfo)
  3740. +     routine(class_SetClassPath)
  3741. +     routine(class_PrependClassPath)
  3742. +     routine(class_GetEText)
  3743. +     routine(class_GetTextBase)
  3744. +     routine(class_GetTextLength)
  3745. + /* common symbols referred to but not defined directly in libc.a */
  3746. +     globalref(_environ)        /* common symbol, defined nowhere */
  3747. +     globalref(_errno)        /* cerror */
  3748. + /* do not delete the following line - make depends on it */
  3749. + #include    <globalrefs._h>
  3750. +     .text
  3751. + _globalcount:
  3752. +      .long    _X_
  3753. + /* special cases for missing entry points under various machine types */
  3754. + /* end of globals.s */
  3755. diff -cr --new-file andrew.orig/overhead/class/machdep/i386_linux/makedo.csh andrew/overhead/class/machdep/i386_linux/makedo.csh
  3756. *** andrew.orig/overhead/class/machdep/i386_linux/makedo.csh
  3757. --- andrew/overhead/class/machdep/i386_linux/makedo.csh    Mon Sep  6 20:53:56 1993
  3758. ***************
  3759. *** 0 ****
  3760. --- 1,94 ----
  3761. + #!/bin/csh -f
  3762. + ## ###################################################################### ##
  3763. + ##         Copyright IBM Corporation 1988,1991 - All Rights Reserved      ##
  3764. + ##        For full copyright information see:'andrew/config/COPYRITE'     ##
  3765. + ## ###################################################################### ##
  3766. + # Script to convert normal object files into a dynamically loadable module.
  3767. + if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew
  3768. + if ($#argv == 0) then
  3769. +     echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..."
  3770. +     echo "  -b overrides /usr/andrew/bin for finding dofix, doindex"
  3771. +     echo "  -d overrides ${ANDREWDIR}/lib for finding libcx.a"
  3772. +     echo "  -e overrides the default entry point"
  3773. +     echo "  -g causes .dog file to be generated for debugger use"
  3774. +     exit 1
  3775. + endif
  3776. + set filelist
  3777. + set bindir="${ANDREWDIR}/bin"
  3778. + set libdir="${ANDREWDIR}/lib"
  3779. + foreach file ($*)
  3780. +     if ($?outcoming) then
  3781. +         set outfile=$file
  3782. +     unset outcoming
  3783. +     continue
  3784. +     endif
  3785. +     if ($?bincoming) then
  3786. +         set bindir=$file
  3787. +     unset bincoming
  3788. +     continue
  3789. +     endif
  3790. +     if ($?libcoming) then
  3791. +     set libdir=$file
  3792. +     unset libcoming
  3793. +     continue
  3794. +     endif
  3795. +     if ($?entrypointcoming) then
  3796. +               set entrypoint=$file
  3797. +               unset entrypointcoming
  3798. +               continue
  3799. +     endif
  3800. +     switch ($file)
  3801. +     case -o:
  3802. +     set outcoming
  3803. +     breaksw
  3804. +     case -b:
  3805. +     set bincoming
  3806. +     breaksw
  3807. +     case -d:
  3808. +     set libcoming
  3809. +     breaksw
  3810. +     case -e:
  3811. +               set entrypointcoming
  3812. +     breaksw
  3813. +     case -g:
  3814. +     set gflag
  3815. +     breaksw
  3816. +     default:
  3817. +     if (! $?outfile) set outfile=$file
  3818. +         set filelist=($filelist $file)
  3819. +     endsw
  3820. + end
  3821. + if ($?outcoming) then
  3822. +     echo "makedo: missing argument to -o switch."
  3823. +     exit 1
  3824. + endif
  3825. + if ($?bincoming) then
  3826. +     echo "makedo: missing argument to -b switch."
  3827. +     exit 1
  3828. + endif
  3829. + if ($?libcoming) then
  3830. +     echo "makedo: missing argument to -d switch."
  3831. +     exit 1
  3832. + endif
  3833. + if ($?entrypointcoming) then
  3834. +     echo "makedo: missing argument to -e switch."
  3835. +     exit 1
  3836. + endif
  3837. + if (! $?filelist) then
  3838. +     echo "makedo: No object modules given."
  3839. +     exit 1
  3840. + endif
  3841. + if (! $?entrypoint) then
  3842. +     set entrypoint=_${outfile:r}__GetClassInfo
  3843. + endif
  3844. + ld -r -o ${outfile:r}.dog $filelist ${libdir}/libcx.a | egrep "ld:"
  3845. + ${bindir}/dofix -e $entrypoint ${outfile:r}.dog
  3846. + set retcode=$status
  3847. + if (! $?gflag) rm ${outfile:r}.dog
  3848. + if (! $retcode) then
  3849. +     ${bindir}/doindex ${outfile:r}.do
  3850. +     set retcode=$status
  3851. + endif
  3852. + exit($retcode)
  3853. diff -cr --new-file andrew.orig/overhead/class/pp/class.c andrew/overhead/class/pp/class.c
  3854. *** andrew.orig/overhead/class/pp/class.c    Sat Jan 25 04:06:51 1992
  3855. --- andrew/overhead/class/pp/class.c    Sat Sep  4 11:54:08 1993
  3856. ***************
  3857. *** 13,18 ****
  3858. --- 13,21 ----
  3859.   #include <ctype.h>
  3860.   #include <signal.h>
  3861.   
  3862. + #ifdef linux
  3863. + #include <bsd/signal.h>
  3864. + #endif
  3865.   /*
  3866.    * define these for the compiler 
  3867.    */
  3868. ***************
  3869. *** 20,26 ****
  3870.   char *malloc(),*realloc();  /* should include stdlib.h */
  3871.   #endif /* _IBMR2 */
  3872.   extern int yylex();        /* using lex */
  3873. ! extern char yytext[];        
  3874.   
  3875.   
  3876.   /*
  3877. --- 23,33 ----
  3878.   char *malloc(),*realloc();  /* should include stdlib.h */
  3879.   #endif /* _IBMR2 */
  3880.   extern int yylex();        /* using lex */
  3881. ! #ifdef linux
  3882. ! extern char * yytext;
  3883. ! #else
  3884. ! extern char yytext[];
  3885. ! #endif
  3886.   
  3887.   
  3888.   /*
  3889. diff -cr --new-file andrew.orig/overhead/class/pp/classpp.l andrew/overhead/class/pp/classpp.l
  3890. *** andrew.orig/overhead/class/pp/classpp.l    Fri Jan 24 04:23:14 1992
  3891. --- andrew/overhead/class/pp/classpp.l    Sat Sep  4 13:15:03 1993
  3892. ***************
  3893. *** 2,7 ****
  3894. --- 2,19 ----
  3895.   #include <classpp.h>
  3896.   extern int nametype;    /* pass back info to class preprocessor */
  3897.   extern void errorexit();    /* what to do if something bad happens */
  3898. + #ifdef FLEX_SCANNER
  3899. + #define MINUS_ONE ({yyless(2); nametype=name_MinusOne;class_Name;})
  3900. +                 /* This is GCC specific. The ({..}) is */
  3901. +                 /* a gcc extension. However, the only */
  3902. +                 /* place that uses flex at the moment */
  3903. +                 /* is linux, so we'll call it */
  3904. +                 /* acceptable. */
  3905. + #define class_TokUnput(a) ({ yyless(yyleng-1); (a); })
  3906. + #define class_TokName(a) ({ yyless(yyleng-1);nametype=(a); class_Name; })
  3907. + #else
  3908. + #define MINUS_ONE (class_TokMinusOne())
  3909. + #endif
  3910.   %}
  3911.   %%
  3912.   class[^A-Z0-9a-z_]        return(class_TokUnput(class_Class));
  3913. ***************
  3914. *** 37,47 ****
  3915.   pointer[^A-Z0-9a-z_]        return(class_TokName(name_Pointer));
  3916.   boolean[^A-Z0-9a-z_]        return(class_TokName(name_Boolean));
  3917.   NULL[^A-Z0-9a-z_]        return(class_TokName(name_NULL));
  3918. ! -1[^0-9]                return(class_TokName(name_MinusOne));    /* wrong, but convenient */
  3919.   exit[^A-Z0-9a-z_]            return(class_TokName(name_Exit));
  3920.   
  3921. ! \/\*                return(class_TokComment());
  3922. ! \"                return(class_TokString());
  3923.   
  3924.   ";"                return(class_Semi);
  3925.   ","                return(class_Comma);
  3926. --- 49,59 ----
  3927.   pointer[^A-Z0-9a-z_]        return(class_TokName(name_Pointer));
  3928.   boolean[^A-Z0-9a-z_]        return(class_TokName(name_Boolean));
  3929.   NULL[^A-Z0-9a-z_]        return(class_TokName(name_NULL));
  3930. ! -1[^0-9]          return MINUS_ONE;    /* wrong, but convenient */
  3931.   exit[^A-Z0-9a-z_]            return(class_TokName(name_Exit));
  3932.   
  3933. ! "/*"([^*]|"*"+[^*/])*"*"+"/"       return(class_Comment);
  3934. ! \"("\".|[^"])\"        return(class_String);
  3935.   
  3936.   ";"                return(class_Semi);
  3937.   ","                return(class_Comma);
  3938. ***************
  3939. *** 63,68 ****
  3940. --- 75,81 ----
  3941.   #undef YYLMAX
  3942.   #define YYLMAX 1000
  3943.   
  3944. + #ifndef FLEX_SCANNER
  3945.   class_TokUnput(tok)
  3946.   short tok;
  3947.   {
  3948. ***************
  3949. *** 78,83 ****
  3950. --- 91,102 ----
  3951.       return class_TokUnput(class_Name);
  3952.   }
  3953.   
  3954. + class_TokMinusOne()
  3955. + {
  3956. +   return class_TokName(name_MinusOne);
  3957. + }
  3958. + #endif
  3959.   class_TokWhitespace()
  3960.   {
  3961.       /* convert an escaped newline into a space */    
  3962. ***************
  3963. *** 89,137 ****
  3964.       return (class_WhiteSpace);
  3965.   }
  3966.   
  3967. - class_TokComment(str)
  3968. - char *str;  {
  3969. -     /* must search to the end of the comment */
  3970. -     /* attempt to return it in str - up to the point that fits */
  3971. -     int i = 2, c, SawStar = 0;
  3972. -     
  3973. -     yytext[YYLMAX-3] = '*';
  3974. -     yytext[YYLMAX-2] = '/';
  3975. -     yytext[YYLMAX-1] = '\0';
  3976. -     
  3977. -     while ((c = input()) > 0)  {
  3978. -     if (i < YYLMAX - 3) yytext[i] = c;
  3979. -     i += 1;
  3980. -     if (SawStar && c == '/') break;
  3981. -     SawStar = (c == '*');
  3982. -     }
  3983. -     if (i < (YYLMAX - 3)) yytext[i] = '\0';
  3984. -     return (class_Comment);
  3985. - }
  3986. - class_TokString(str)
  3987. - char *str;  {
  3988. -     int i = 1, c, SawBackSlash = 0;
  3989. -     
  3990. -     yytext[YYLMAX-2] = '"';
  3991. -     yytext[YYLMAX-1] = '0';
  3992. -     
  3993. -     while ((c = input()) > 0)  {
  3994. -     if (i < YYLMAX - 2) yytext[i] = c;
  3995. -     i += 1;
  3996. -     if (! SawBackSlash && c == '"') break;
  3997. -     SawBackSlash = (c == '\\');
  3998. -     }
  3999. -     if (i < (YYLMAX - 2)) yytext[i] = '\0';
  4000. -     if (i > (YYLMAX - 2))  {
  4001. -     fprintf(stderr, "String Constant too long - truncated\n");
  4002. -     }
  4003. -     return (class_String);
  4004. - }
  4005.   
  4006.   
  4007.   static int FilePtr = 0;
  4008.   static FILE *FileStack[FILESTACKSIZE];
  4009.   
  4010.   void PushFile(file)
  4011. --- 108,118 ----
  4012.       return (class_WhiteSpace);
  4013.   }
  4014.   
  4015.   
  4016.   
  4017.   static int FilePtr = 0;
  4018. +                                                                    
  4019. + #ifndef FLEX_SCANNER
  4020.   static FILE *FileStack[FILESTACKSIZE];
  4021.   
  4022.   void PushFile(file)
  4023. ***************
  4024. *** 154,160 ****
  4025. --- 135,166 ----
  4026.       yyin = FileStack[FilePtr-1];
  4027.       }
  4028.   }
  4029. + #else /* flex scanner. */
  4030. + static YY_BUFFER_STATE FileStack[FILESTACKSIZE];
  4031. + void PushFile(file)
  4032. +      FILE *file;  {
  4033. +     if (FilePtr >= FILESTACKSIZE) {
  4034. +     errorexit(EXITCODE_BUG, "PushFile stack is full!");
  4035. +     }
  4036. +     yy_switch_to_buffer(yy_create_buffer(file, YY_BUF_SIZE));
  4037. +     FileStack[FilePtr] = YY_CURRENT_BUFFER;
  4038. +     FilePtr += 1;
  4039. + }
  4040.   
  4041. + void PopFile()  {
  4042. +     YY_BUFFER_STATE now = YY_CURRENT_BUFFER;
  4043. +     fclose(yyin);
  4044. +     if (FilePtr < 1) {
  4045. +     errorexit(EXITCODE_BUG, "PopFile stack is empty!");
  4046. +     }
  4047. +     FilePtr -=1;
  4048. +     if (FilePtr > 0)  {
  4049. +         yy_switch_to_buffer(FileStack[FilePtr-1]);
  4050. +         yy_delete_buffer(now);
  4051. +     }
  4052. + }
  4053. + #endif
  4054.   
  4055.   /* ********************************************************************** *\
  4056.    *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
  4057. ***************
  4058. *** 161,164 ****
  4059.    *        For full copyright information see:'andrew/config/COPYRITE'     *
  4060.   \* ********************************************************************** */
  4061.   
  4062. !     /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/class/pp/RCS/classpp.l,v 2.4 1991/09/17 19:20:27 susan Exp $ */
  4063. \ No newline at end of file
  4064. --- 167,170 ----
  4065.    *        For full copyright information see:'andrew/config/COPYRITE'     *
  4066.   \* ********************************************************************** */
  4067.   
  4068. !     /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/class/pp/RCS/classpp.l,v 2.4 1991/09/17 19:20:27 susan Exp $ */
  4069. diff -cr --new-file andrew.orig/overhead/eli/lib/elil.l andrew/overhead/eli/lib/elil.l
  4070. *** andrew.orig/overhead/eli/lib/elil.l    Fri Jan 24 04:24:29 1992
  4071. --- andrew/overhead/eli/lib/elil.l    Sat Sep  4 11:59:04 1993
  4072. ***************
  4073. *** 1,6 ****
  4074. --- 1,9 ----
  4075.   /* See end for RCS and copyright info */
  4076.   
  4077.   %{
  4078. + #ifdef FLEX_SCANNER
  4079. + #undef yywrap
  4080. + #endif
  4081.   #include <eli.h>
  4082.   #include <eliy.h>
  4083.   
  4084. ***************
  4085. *** 66,87 ****
  4086.   ******************************************************************/
  4087.   static char *elil_rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lib/RCS/elil.l,v 2.9 1991/09/13 16:47:10 bobg Exp $";
  4088.   
  4089.   
  4090. ! #undef input
  4091.   
  4092. ! static int  input()        /* Replaces the lex macro */
  4093.   {
  4094.       int             result;
  4095.       switch (EliProcessInfo.u_source) {    /* Where is the input coming from? */
  4096.       case e_source_stdin:
  4097. !         result = ((yytchar = yysptr > yysbuf ?
  4098. !             U(*--yysptr) : getc(yyin)) == 10 ?
  4099. !             (yylineno++, yytchar) : yytchar) == EOF ?
  4100. !             0 : yytchar;
  4101. !         /*
  4102. !          * This ugly expression is what comes with lex
  4103. !          */
  4104.           break;
  4105.       case e_source_string:
  4106.           result = (int) *(EliProcessInfo.u_sourcestring++);    /* No need to test for
  4107. --- 69,89 ----
  4108.   ******************************************************************/
  4109.   static char *elil_rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lib/RCS/elil.l,v 2.9 1991/09/13 16:47:10 bobg Exp $";
  4110.   
  4111. + #ifdef FLEX_SCANNER
  4112.   
  4113. ! #else
  4114.   
  4115. ! #undef YY_INPUT
  4116. ! #define YY_INPUT(buf, result, max_size) ((result) =my_input((buf), (max_size)))
  4117. ! static int  my_input(char *buf, int max_size)
  4118.   {
  4119.       int             result;
  4120. !   
  4121.       switch (EliProcessInfo.u_source) {    /* Where is the input coming from? */
  4122.       case e_source_stdin:
  4123. !         result = input();
  4124. !         if (!result)
  4125. !           return 0;
  4126.           break;
  4127.       case e_source_string:
  4128.           result = (int) *(EliProcessInfo.u_sourcestring++);    /* No need to test for
  4129. ***************
  4130. *** 99,108 ****
  4131.           result = 0;
  4132.           break;
  4133.       }
  4134. !     return (result);
  4135.   }
  4136.   
  4137.   
  4138.   #undef unput
  4139.   
  4140.   static unput(c)        /* Replaces the lex macro */
  4141. --- 101,113 ----
  4142.           result = 0;
  4143.           break;
  4144.       }
  4145. !     if (!result) return 0 ;
  4146. !     return 1;
  4147.   }
  4148.   
  4149. + #endif
  4150.   
  4151. + #ifndef FLEX_SCANNER
  4152.   #undef unput
  4153.   
  4154.   static unput(c)        /* Replaces the lex macro */
  4155. ***************
  4156. *** 124,129 ****
  4157. --- 129,135 ----
  4158.           break;
  4159.       }
  4160.   }
  4161. + #endif
  4162.   
  4163.   static void AddToYParseBuf(c, grow)
  4164.   int c, grow;
  4165. diff -cr --new-file andrew.orig/overhead/eli/lib/prims1.c andrew/overhead/eli/lib/prims1.c
  4166. *** andrew.orig/overhead/eli/lib/prims1.c    Fri Jan 24 04:24:40 1992
  4167. --- andrew/overhead/eli/lib/prims1.c    Sat Sep  4 12:06:50 1993
  4168. ***************
  4169. *** 13,19 ****
  4170.   
  4171.   #include  <prmtives.h>
  4172.   #include <sys/errno.h>
  4173.   static struct {
  4174.       char           *name;
  4175.       void            (*fn) ();
  4176. --- 13,21 ----
  4177.   
  4178.   #include  <prmtives.h>
  4179.   #include <sys/errno.h>
  4180. ! #ifdef linux
  4181. ! #include <sys/wait.h>
  4182. ! #endif
  4183.   static struct {
  4184.       char           *name;
  4185.       void            (*fn) ();
  4186. ***************
  4187. *** 1970,1976 ****
  4188.           EliStr_t       *resultstrs[2];
  4189.           struct itimerval itimer, olditimer;
  4190.   
  4191. ! #if defined(SGI_4D_ENV)
  4192.       setpgrp();
  4193.   #else
  4194.           setpgrp(childpid, childpid);
  4195. --- 1972,1978 ----
  4196.           EliStr_t       *resultstrs[2];
  4197.           struct itimerval itimer, olditimer;
  4198.   
  4199. ! #if defined(SGI_4D_ENV) || defined(linux)
  4200.       setpgrp();
  4201.   #else
  4202.           setpgrp(childpid, childpid);
  4203. ***************
  4204. *** 2416,2423 ****
  4205.           }
  4206.           free(stderrstr);
  4207.           EliSexp_SetInt(st, resultnodes[0],
  4208. !                         ((int) waitstat.w_T.w_Retcode)
  4209. !                         + (((int) waitstat.w_T.w_Coredump) << 8));
  4210.           EliSexp_SetStr(st, resultnodes[1], resultstrs[0]);
  4211.           EliSexp_SetStr(st, resultnodes[2], resultstrs[1]);
  4212.           if (!(reslist = EliAddToList(st, reslist, resultnodes[0])))
  4213. --- 2418,2425 ----
  4214.           }
  4215.           free(stderrstr);
  4216.           EliSexp_SetInt(st, resultnodes[0],
  4217. !                         ((int) WEXITSTATUS(waitstat))
  4218. !                         + (((int) WCOREDUMP(waitstat)) << 8));
  4219.           EliSexp_SetStr(st, resultnodes[1], resultstrs[0]);
  4220.           EliSexp_SetStr(st, resultnodes[2], resultstrs[1]);
  4221.           if (!(reslist = EliAddToList(st, reslist, resultnodes[0])))
  4222. diff -cr --new-file andrew.orig/overhead/index/index.c andrew/overhead/index/index.c
  4223. *** andrew.orig/overhead/index/index.c    Fri Jan 24 04:27:49 1992
  4224. --- andrew/overhead/index/index.c    Sat Sep  4 11:07:58 1993
  4225. ***************
  4226. *** 11,17 ****
  4227.   #endif /* lint */
  4228.   
  4229.   #include <andrewos.h> /* sys/types.h sys/file.h */
  4230. ! #ifdef M_UNIX
  4231.   #include <dirent.h>
  4232.   #define direct dirent
  4233.   #else
  4234. --- 11,17 ----
  4235.   #endif /* lint */
  4236.   
  4237.   #include <andrewos.h> /* sys/types.h sys/file.h */
  4238. ! #if defined(M_UNIX) || defined(linux)
  4239.   #include <dirent.h>
  4240.   #define direct dirent
  4241.   #else
  4242. diff -cr --new-file andrew.orig/overhead/index/indexio.c andrew/overhead/index/indexio.c
  4243. *** andrew.orig/overhead/index/indexio.c    Fri Jan 24 04:27:51 1992
  4244. --- andrew/overhead/index/indexio.c    Sat Sep  4 11:08:11 1993
  4245. ***************
  4246. *** 11,17 ****
  4247.   #endif /* lint */
  4248.   
  4249.   #include <andrewos.h> /* sys/types.h sys/file.h */
  4250. ! #ifdef M_UNIX
  4251.   #include <dirent.h>
  4252.   #define direct dirent
  4253.   #else
  4254. --- 11,17 ----
  4255.   #endif /* lint */
  4256.   
  4257.   #include <andrewos.h> /* sys/types.h sys/file.h */
  4258. ! #if defined(M_UNIX) || defined(linux)
  4259.   #include <dirent.h>
  4260.   #define direct dirent
  4261.   #else
  4262. diff -cr --new-file andrew.orig/overhead/mail/lib/parsel.l andrew/overhead/mail/lib/parsel.l
  4263. *** andrew.orig/overhead/mail/lib/parsel.l    Fri Jan 24 04:28:22 1992
  4264. --- andrew/overhead/mail/lib/parsel.l    Sat Sep  4 12:01:59 1993
  4265. ***************
  4266. *** 42,50 ****
  4267.   
  4268.   YYSTYPE yylval;
  4269.   
  4270. ! #ifndef hp9000s300
  4271.   extern char yytext[];
  4272.   #endif
  4273.   
  4274.   static char *CurrentLine, *CurrentChar, *cbuffer;
  4275.   
  4276. --- 42,54 ----
  4277.   
  4278.   YYSTYPE yylval;
  4279.   
  4280. ! #if !defined(hp9000s300)
  4281. ! #ifdef linux
  4282. ! extern char * yytext;
  4283. ! #else
  4284.   extern char yytext[];
  4285.   #endif
  4286. + #endif
  4287.   
  4288.   static char *CurrentLine, *CurrentChar, *cbuffer;
  4289.   
  4290. ***************
  4291. *** 62,68 ****
  4292.       yycomments = NIL;
  4293.       ParseErrorReason = PA_SYNTAX_ERROR;
  4294.   }
  4295.   #undef input
  4296.   static char input()
  4297.   {
  4298. --- 66,72 ----
  4299.       yycomments = NIL;
  4300.       ParseErrorReason = PA_SYNTAX_ERROR;
  4301.   }
  4302. ! #ifndef FLEX_SCANNER
  4303.   #undef input
  4304.   static char input()
  4305.   {
  4306. ***************
  4307. *** 83,92 ****
  4308. --- 87,114 ----
  4309.       if (CurrentChar > CurrentLine)
  4310.       *--CurrentChar = c;
  4311.   }
  4312. + #else
  4313. + #undef YY_INPUT
  4314. + #define YY_INPUT(buf, result, max_size) (result = my_input(buf, max_size))
  4315. + static int my_input(char *buf, int max_size)
  4316. +   {
  4317. +       register char c;
  4318. +   
  4319. +     *buf = c = *CurrentChar++;
  4320. +     if ((c & 0x80) || c == 04)    /* High-order bit is on, or it's a ^D */
  4321. +     *buf = 1;
  4322. +     if (!(*buf)) return 0;
  4323. +     return 1;
  4324. +   }
  4325.   
  4326. + #endif
  4327.   #undef YYLMAX
  4328.   #define YYLMAX 400
  4329.   
  4330. + #ifdef FLEX_SCANNER
  4331. + #undef yywrap
  4332. + #endif
  4333.   int yywrap()
  4334.   {
  4335.       return 1;
  4336. diff -cr --new-file andrew.orig/overhead/mail/lib/qmail.c andrew/overhead/mail/lib/qmail.c
  4337. *** andrew.orig/overhead/mail/lib/qmail.c    Fri Jan 24 04:28:15 1992
  4338. --- andrew/overhead/mail/lib/qmail.c    Sat Sep  4 11:16:11 1993
  4339. ***************
  4340. *** 119,125 ****
  4341.   #include <stdio.h>
  4342.   #include <sys/param.h>
  4343.   #include <fdplumb.h>
  4344. ! #ifdef M_UNIX
  4345.   #include <dirent.h>
  4346.   #define direct dirent
  4347.   #define namlen(d) (strlen((d)->d_name))
  4348. --- 119,125 ----
  4349.   #include <stdio.h>
  4350.   #include <sys/param.h>
  4351.   #include <fdplumb.h>
  4352. ! #if defined(M_UNIX) || defined(linux)
  4353.   #include <dirent.h>
  4354.   #define direct dirent
  4355.   #define namlen(d) (strlen((d)->d_name))
  4356. diff -cr --new-file andrew.orig/overhead/mail/lib/stats.c andrew/overhead/mail/lib/stats.c
  4357. *** andrew.orig/overhead/mail/lib/stats.c    Fri Jan 24 04:28:25 1992
  4358. --- andrew/overhead/mail/lib/stats.c    Sat Sep  4 12:06:51 1993
  4359. ***************
  4360. *** 335,341 ****
  4361.   
  4362.       /* Format system info */
  4363.       Format(ModuleName, module, LOGSTRLEN);
  4364. ! #ifdef SGI_4D_ENV
  4365.       sprintf(buffer,
  4366.           "%04d-%02d-%02d %02d:%02d:%02d.%02d %s %10d %6d %6d %s %5d %11d %s; ",
  4367.           now->tm_year+1900, now->tm_mon+1, now->tm_mday,
  4368. --- 335,341 ----
  4369.   
  4370.       /* Format system info */
  4371.       Format(ModuleName, module, LOGSTRLEN);
  4372. ! #if defined(SGI_4D_ENV) || defined(linux)
  4373.       sprintf(buffer,
  4374.           "%04d-%02d-%02d %02d:%02d:%02d.%02d %s %10d %6d %6d %s %5d %11d %s; ",
  4375.           now->tm_year+1900, now->tm_mon+1, now->tm_mday,
  4376. diff -cr --new-file andrew.orig/overhead/parsec/tokens.l andrew/overhead/parsec/tokens.l
  4377. *** andrew.orig/overhead/parsec/tokens.l    Fri Jan 24 04:28:57 1992
  4378. --- andrew/overhead/parsec/tokens.l    Sat Sep  4 12:02:45 1993
  4379. ***************
  4380. *** 23,29 ****
  4381.   #define yylex PC_NextToken
  4382.   
  4383.   extern int PC_IsTypedef(), PC_IsEnumerator();
  4384.   static int yywrap()
  4385.   {
  4386.       return(1);
  4387. --- 23,31 ----
  4388.   #define yylex PC_NextToken
  4389.   
  4390.   extern int PC_IsTypedef(), PC_IsEnumerator();
  4391. ! #ifdef FLEX_SCANNER
  4392. ! #undef yywrap
  4393. ! #endif
  4394.   static int yywrap()
  4395.   {
  4396.       return(1);
  4397. diff -cr --new-file andrew.orig/overhead/snap2/pcserver/pcsprocs.c andrew/overhead/snap2/pcserver/pcsprocs.c
  4398. *** andrew.orig/overhead/snap2/pcserver/pcsprocs.c    Fri Jan 24 04:29:57 1992
  4399. --- andrew/overhead/snap2/pcserver/pcsprocs.c    Sat Sep  4 11:16:01 1993
  4400. ***************
  4401. *** 31,37 ****
  4402.   #include <sys/errno.h>
  4403.   #include <sys/param.h>
  4404.   #include <sys/stat.h>
  4405. ! #ifdef M_UNIX
  4406.   #include <dirent.h>
  4407.   #define direct dirent
  4408.   #define namlen(d) (strlen((d)->d_name))
  4409. --- 31,37 ----
  4410.   #include <sys/errno.h>
  4411.   #include <sys/param.h>
  4412.   #include <sys/stat.h>
  4413. ! #if defined(M_UNIX) || defined(linux)
  4414.   #include <dirent.h>
  4415.   #define direct dirent
  4416.   #define namlen(d) (strlen((d)->d_name))
  4417. diff -cr --new-file andrew.orig/overhead/snap2/pcserver/pcsutils.c andrew/overhead/snap2/pcserver/pcsutils.c
  4418. *** andrew.orig/overhead/snap2/pcserver/pcsutils.c    Fri Jan 24 04:29:59 1992
  4419. --- andrew/overhead/snap2/pcserver/pcsutils.c    Sat Sep  4 11:15:51 1993
  4420. ***************
  4421. *** 26,32 ****
  4422.   #include <sys/errno.h>
  4423.   #include <sys/param.h>
  4424.   #include <sys/stat.h>
  4425. ! #ifdef M_UNIX
  4426.   #include <dirent.h>
  4427.   #define direct dirent
  4428.   #define namlen(d) (strlen((d)->d_name))
  4429. --- 26,32 ----
  4430.   #include <sys/errno.h>
  4431.   #include <sys/param.h>
  4432.   #include <sys/stat.h>
  4433. ! #if defined(M_UNIX) || defined(linux)
  4434.   #include <dirent.h>
  4435.   #define direct dirent
  4436.   #define namlen(d) (strlen((d)->d_name))
  4437. diff -cr --new-file andrew.orig/overhead/util/lib/fselect.c andrew/overhead/util/lib/fselect.c
  4438. *** andrew.orig/overhead/util/lib/fselect.c    Fri Jan 24 04:31:14 1992
  4439. --- andrew/overhead/util/lib/fselect.c    Sat Sep  4 12:06:51 1993
  4440. ***************
  4441. *** 12,17 ****
  4442. --- 12,26 ----
  4443.   #include <stdio.h>
  4444.   #include <andrewos.h>        /* sys/time.h */
  4445.   
  4446. +                 /* Useing internals of FILE * struct. */
  4447. +                 /* Yuck yuck yuck. This adds support */
  4448. +                 /* for the GNU streambuf FILE. */
  4449. + #if defined(linux) || defined(HAVE_STREAMBUF)
  4450. + #define FILE_USED(f) ((f)->_egptr - (f)->_gptr)
  4451. + #else
  4452. + #define FILE_USED(f) ((f)->_cnt)
  4453. + #endif
  4454.   static int NOFILES;
  4455.   
  4456.   int fselect(nfds, rfiles, wfiles, xfiles, timeout)
  4457. ***************
  4458. *** 30,36 ****
  4459.       for (i = nfds; --i >= 0;) {
  4460.       register int fd;
  4461.       if (rfiles && rfiles[i] != NULL && (fd = fileno(rfiles[i])) >= 0 && fd < NOFILES) 
  4462. !         if (rfiles[i]->_cnt > 0) 
  4463.           ret++;
  4464.           else
  4465.           rmask |= 1<<fd;
  4466. --- 39,45 ----
  4467.       for (i = nfds; --i >= 0;) {
  4468.       register int fd;
  4469.       if (rfiles && rfiles[i] != NULL && (fd = fileno(rfiles[i])) >= 0 && fd < NOFILES) 
  4470. !         if (FILE_USED(rfiles[i]) > 0) 
  4471.           ret++;
  4472.           else
  4473.           rmask |= 1<<fd;
  4474. ***************
  4475. *** 43,49 ****
  4476.       ret = select(NOFILES, &rmask, &wmask, &xmask, timeout);
  4477.       else rmask = wmask = xmask = 0;
  4478.       for (i = nfds; --i >= 0;) {
  4479. !     if (rfiles && rfiles[i] != NULL && rfiles[i]->_cnt <= 0 
  4480.           && (rmask & (1<<fileno(rfiles[i]))) == 0)
  4481.           rfiles[i] = NULL;
  4482.       if (wfiles && wfiles[i] != NULL && (wmask & (1<<fileno(wfiles[i]))) == 0)
  4483. --- 52,58 ----
  4484.       ret = select(NOFILES, &rmask, &wmask, &xmask, timeout);
  4485.       else rmask = wmask = xmask = 0;
  4486.       for (i = nfds; --i >= 0;) {
  4487. !     if (rfiles && rfiles[i] != NULL && FILE_USED(rfiles[i]) <= 0 
  4488.           && (rmask & (1<<fileno(rfiles[i]))) == 0)
  4489.           rfiles[i] = NULL;
  4490.       if (wfiles && wfiles[i] != NULL && (wmask & (1<<fileno(wfiles[i]))) == 0)
  4491. diff -cr --new-file andrew.orig/overhead/util/lib/pause.c andrew/overhead/util/lib/pause.c
  4492. *** andrew.orig/overhead/util/lib/pause.c    Fri Jan 24 04:31:28 1992
  4493. --- andrew/overhead/util/lib/pause.c    Sat Sep  4 11:14:42 1993
  4494. ***************
  4495. *** 35,41 ****
  4496.   #define    RPAUSE_ENABLE    2    /* enable pause on error */
  4497.   
  4498.   #define    RPAUSE_ALL    0x7fffffff        /* all error number types */
  4499. ! #if defined(AIX) || defined(M_UNIX)
  4500.       return 0;
  4501.   #else /* #ifdef AIX */
  4502.       struct sigvec OldS, NewS;
  4503. --- 35,41 ----
  4504.   #define    RPAUSE_ENABLE    2    /* enable pause on error */
  4505.   
  4506.   #define    RPAUSE_ALL    0x7fffffff        /* all error number types */
  4507. ! #if defined(AIX) || defined(M_UNIX) || defined(linux)
  4508.       return 0;
  4509.   #else /* #ifdef AIX */
  4510.       struct sigvec OldS, NewS;
  4511. diff -cr --new-file andrew.orig/overhead/util/lib/t2open.c andrew/overhead/util/lib/t2open.c
  4512. *** andrew.orig/overhead/util/lib/t2open.c    Sun Apr  5 02:53:25 1992
  4513. --- andrew/overhead/util/lib/t2open.c    Sat Sep  4 12:06:52 1993
  4514. ***************
  4515. *** 53,59 ****
  4516.   
  4517.       /* This is child */
  4518.       pid = getpid();
  4519. ! #if defined(hpux) || defined(SGI_4D_ENV)
  4520.       setpgrp();
  4521.   #else /* hpux */
  4522.       setpgrp(pid, pid);
  4523. --- 53,59 ----
  4524.   
  4525.       /* This is child */
  4526.       pid = getpid();
  4527. ! #if defined(hpux) || defined(SGI_4D_ENV) || defined(linux)
  4528.       setpgrp();
  4529.   #else /* hpux */
  4530.       setpgrp(pid, pid);
  4531. diff -cr --new-file andrew.orig/overhead/util/lib/times.c andrew/overhead/util/lib/times.c
  4532. *** andrew.orig/overhead/util/lib/times.c    Fri Jan 24 04:31:40 1992
  4533. --- andrew/overhead/util/lib/times.c    Sat Sep  4 12:06:52 1993
  4534. ***************
  4535. *** 11,17 ****
  4536.   
  4537.   #include <errno.h>
  4538.   #include <andrewos.h>
  4539. ! #if (!defined(_IBMR2) && !SY_AIXx && !defined(HP300_ENV) && !defined(HP700_ENV) && !defined(HP800_ENV) && !defined(M_UNIX) && (!defined(SGI_4D_ENV)) && !defined(SUN_ENV))
  4540.   extern char *timezone();
  4541.   #endif /* (!defined(_IBMR2) && !SY_AIXx && !defined(HP300_ENV) && !defined(HP800_ENV)) */
  4542.   
  4543. --- 11,17 ----
  4544.   
  4545.   #include <errno.h>
  4546.   #include <andrewos.h>
  4547. ! #if (!defined(_IBMR2) && !SY_AIXx && !defined(HP300_ENV) && !defined(HP700_ENV) && !defined(HP800_ENV) && !defined(M_UNIX) && (!defined(SGI_4D_ENV)) && !defined(SUN_ENV)) && !defined(linux)
  4548.   extern char *timezone();
  4549.   #endif /* (!defined(_IBMR2) && !SY_AIXx && !defined(HP300_ENV) && !defined(HP800_ENV)) */
  4550.   
  4551. ***************
  4552. *** 67,76 ****
  4553. --- 67,84 ----
  4554.       gettimeofday(&TV, &TZ);
  4555.       osi_SecondsWest = (long) TZ.tz_minuteswest * 60;
  4556.       osi_IsEverDaylight = TZ.tz_dsttime;
  4557. + #ifdef linux
  4558. +     strncpy(TZ0, tzname, sizeof(TZ0) - 1);
  4559. + #else
  4560.       strncpy(TZ0, timezone(TZ.tz_minuteswest, 0), sizeof(TZ0) - 1);
  4561. + #endif
  4562.       TZ0[sizeof(TZ0) - 1] = '\0';
  4563.       osi_ZoneNames[0] = TZ0;
  4564. + #ifdef linux
  4565. +     strncpy(TZ1, tzname, sizeof(TZ1) - 1);
  4566. + #else
  4567.       strncpy(TZ1, timezone(TZ.tz_minuteswest, 1), sizeof(TZ1) - 1);
  4568. + #endif
  4569.       TZ1[sizeof(TZ1) - 1] = '\0';
  4570.       osi_ZoneNames[1] = TZ1;
  4571.       ZonesInitialized = 1;
  4572. diff -cr --new-file andrew.orig/overhead/util/lib/topen.c andrew/overhead/util/lib/topen.c
  4573. *** andrew.orig/overhead/util/lib/topen.c    Fri Jan 24 04:31:43 1992
  4574. --- andrew/overhead/util/lib/topen.c    Sat Sep  4 12:06:52 1993
  4575. ***************
  4576. *** 58,64 ****
  4577.       /* myside and hisside reverse roles in child */
  4578.       sigchild();
  4579.       pid = getpid();
  4580. ! #if defined(hpux) || defined(SGI_4D_ENV)
  4581.       setpgrp();
  4582.   #else /* hpux */
  4583.       setpgrp(pid, pid);
  4584. --- 58,64 ----
  4585.       /* myside and hisside reverse roles in child */
  4586.       sigchild();
  4587.       pid = getpid();
  4588. ! #if defined(hpux) || defined(SGI_4D_ENV) ||defined(linux)
  4589.       setpgrp();
  4590.   #else /* hpux */
  4591.       setpgrp(pid, pid);
  4592. diff -cr --new-file andrew.orig/overhead/util/lib/unscribe.c andrew/overhead/util/lib/unscribe.c
  4593. *** andrew.orig/overhead/util/lib/unscribe.c    Fri Jan 24 04:32:05 1992
  4594. --- andrew/overhead/util/lib/unscribe.c    Sat Sep  4 12:06:54 1993
  4595. ***************
  4596. *** 21,26 ****
  4597. --- 21,30 ----
  4598.   #include <util.h>
  4599.   #include <unscribe.h>
  4600.   
  4601. + #ifdef linux
  4602. + #include <bsd/bsd.h>        /* grab a MIN definition. */
  4603. + #endif
  4604.   /* #define SPECIALFACES 1 */
  4605.   
  4606.   #define Version1        0
  4607. diff -cr --new-file andrew.orig/overhead/util/lib/usignal.c andrew/overhead/util/lib/usignal.c
  4608. *** andrew.orig/overhead/util/lib/usignal.c    Fri Jan 24 04:31:49 1992
  4609. --- andrew/overhead/util/lib/usignal.c    Sat Sep  4 11:13:55 1993
  4610. ***************
  4611. *** 22,28 ****
  4612.   {
  4613.   /* Returns a pointer to a static buffer containing English text describing the same signal condition that signalNumber describes (interpreted as a Unix signal number).  The text has no newlines in it.  We contend that this is what ``psignal'' should have been returning all along. */
  4614.       static char SigBuff[40];
  4615. ! #if (!defined(hpux)) && (!defined(AIX) && !defined(M_UNIX))
  4616.       extern char *sys_siglist[];
  4617.   
  4618.       if (signalNumber < NSIG && signalNumber > 0) return sys_siglist[signalNumber];
  4619. --- 22,28 ----
  4620.   {
  4621.   /* Returns a pointer to a static buffer containing English text describing the same signal condition that signalNumber describes (interpreted as a Unix signal number).  The text has no newlines in it.  We contend that this is what ``psignal'' should have been returning all along. */
  4622.       static char SigBuff[40];
  4623. ! #if (!defined(hpux)) && (!defined(AIX) && !defined(M_UNIX)) && !defined(linux)
  4624.       extern char *sys_siglist[];
  4625.   
  4626.       if (signalNumber < NSIG && signalNumber > 0) return sys_siglist[signalNumber];
  4627. diff -cr --new-file andrew.orig/xmkfontd/Imakefile andrew/xmkfontd/Imakefile
  4628. *** andrew.orig/xmkfontd/Imakefile    Fri Jan 24 03:38:52 1992
  4629. --- andrew/xmkfontd/Imakefile    Wed Sep  8 22:49:44 1993
  4630. ***************
  4631. *** 2,8 ****
  4632. --- 2,11 ----
  4633.    *         Copyright IBM Corporation 1988,1991 - All Rights Reserved      *
  4634.    *        For full copyright information see:'andrew/config/COPYRITE'     *
  4635.   \* ********************************************************************** */
  4636. + #define ISO80_FONTS_ENV
  4637. + #undef NO_FONTS_ENV
  4638.   #ifndef NO_FONTS_ENV
  4639. + #define RE
  4640.   #if SY_AIX221
  4641.   install.time::
  4642.       ${RM} ${DESTDIR}/X11fonts/fonts.alias
  4643. ***************
  4644. *** 11,22 ****
  4645.       ./aixrt.csh ${DESTDIR}/X11fonts .rtx
  4646.   #else /* SY_AIX221 */
  4647.   #ifndef RELEASE2_ENV
  4648. - install.time::
  4649. -     ${RM} ${DESTDIR}/X11fonts/fonts.alias
  4650. -     ${XMKFONTDIR} $(DESTDIR)/X11fonts
  4651.   #ifdef ISO80_FONTS_ENV
  4652.   InstallFileToFile(non-andrew.fonts.alias, ${INSTLIBFLAGS}, ${DESTDIR}/X11fonts/fonts.alias)
  4653.   #else  /* ISO80_FONTS_ENV */
  4654.   #ifdef SCOunix
  4655.   #ifdef FONTS_TO_PCF_ENV
  4656.       ${CSHELL} ./mkfntdir.csh ${DESTDIR}/X11fonts .pcf
  4657. --- 14,25 ----
  4658.       ./aixrt.csh ${DESTDIR}/X11fonts .rtx
  4659.   #else /* SY_AIX221 */
  4660.   #ifndef RELEASE2_ENV
  4661.   #ifdef ISO80_FONTS_ENV
  4662.   InstallFileToFile(non-andrew.fonts.alias, ${INSTLIBFLAGS}, ${DESTDIR}/X11fonts/fonts.alias)
  4663.   #else  /* ISO80_FONTS_ENV */
  4664. + install.time::
  4665. +     ${RM} ${DESTDIR}/X11fonts/fonts.alias
  4666. +     ${XMKFONTDIR} $(DESTDIR)/X11fonts
  4667.   #ifdef SCOunix
  4668.   #ifdef FONTS_TO_PCF_ENV
  4669.       ${CSHELL} ./mkfntdir.csh ${DESTDIR}/X11fonts .pcf
  4670.  
  4671.